teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone

Blame SOURCES/0789-journal-gateway-explicitly-declare-local-variables.patch

ff2b41
From c101d92274043d6d219b97fb356f8827407c3eeb Mon Sep 17 00:00:00 2001
ff2b41
From: Yu Watanabe <watanabe.yu+github@gmail.com>
ff2b41
Date: Wed, 27 Jun 2018 14:22:24 +0900
ff2b41
Subject: [PATCH] journal-gateway: explicitly declare local variables
ff2b41
ff2b41
Suggested by LGTM.
ff2b41
ff2b41
(cherry picked from commit c497e449f41774a36e01ae2cc2abade6133dffe1)
ff2b41
ff2b41
Resolves: #1694605
ff2b41
---
ff2b41
 src/journal-remote/browse.html | 11 ++++++-----
ff2b41
 1 file changed, 6 insertions(+), 5 deletions(-)
ff2b41
ff2b41
diff --git a/src/journal-remote/browse.html b/src/journal-remote/browse.html
ff2b41
index 3594f70c87..30615795b3 100644
ff2b41
--- a/src/journal-remote/browse.html
ff2b41
+++ b/src/journal-remote/browse.html
ff2b41
@@ -304,7 +304,6 @@
ff2b41
                         var buf = '';
ff2b41
 
ff2b41
                         for (i in l) {
ff2b41
-
ff2b41
                                 if (l[i] == '')
ff2b41
                                         continue;
ff2b41
 
ff2b41
@@ -322,6 +321,7 @@
ff2b41
                                 else
ff2b41
                                         priority = 6;
ff2b41
 
ff2b41
+                                var clazz;
ff2b41
                                 if (priority <= 3)
ff2b41
                                         clazz = "message-error";
ff2b41
                                 else if (priority <= 5)
ff2b41
@@ -388,7 +388,7 @@
ff2b41
                         var d = JSON.parse(event.currentTarget.responseText);
ff2b41
 
ff2b41
                         document.getElementById("diventry").style.display = "block";
ff2b41
-                        entry = document.getElementById("tableentry");
ff2b41
+                        var entry = document.getElementById("tableentry");
ff2b41
 
ff2b41
                         var buf = "";
ff2b41
                         for (var key in d){
ff2b41
@@ -455,7 +455,7 @@
ff2b41
                                 (event.currentTarget.status != 200 && event.currentTarget.status != 0))
ff2b41
                                 return;
ff2b41
 
ff2b41
-                        f = document.getElementById("filter");
ff2b41
+                        var f = document.getElementById("filter");
ff2b41
 
ff2b41
                         var l = event.currentTarget.responseText.split('\n');
ff2b41
                         var buf = '<option>No filter</option>';
ff2b41
@@ -511,11 +511,12 @@
ff2b41
                 }
ff2b41
 
ff2b41
                 function initFilter() {
ff2b41
-                        f = document.getElementById("filter");
ff2b41
+                        var f = document.getElementById("filter");
ff2b41
 
ff2b41
                         var buf = '<option>No filter</option>';
ff2b41
 
ff2b41
                         var filter = localStorage["filter"];
ff2b41
+                        var j;
ff2b41
                         if (filter != null && filter != "") {
ff2b41
                                 buf += '<option value="' + escape(filter) + '">' + escapeHTML(filter) + '</option>';
ff2b41
                                 j = 1;
ff2b41
@@ -529,7 +530,7 @@
ff2b41
                 function installHandlers() {
ff2b41
                         document.onkeyup = onKeyUp;
ff2b41
 
ff2b41
-                        logs = document.getElementById("divlogs");
ff2b41
+                        var logs = document.getElementById("divlogs");
ff2b41
                         logs.addEventListener("mousewheel", onMouseWheel, false);
ff2b41
                         logs.addEventListener("DOMMouseScroll", onMouseWheel, false);
ff2b41
                 }