naccyde / rpms / systemd

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