valeriyvdovin / rpms / systemd

Forked from rpms/systemd 4 years ago
Clone

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

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