]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4716: Blank lines in cachemgr.conf are not skipped (#274) M-staged-PR274
authorAmos Jeffries <yadij@users.noreply.github.com>
Wed, 5 Sep 2018 15:23:45 +0000 (15:23 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Wed, 5 Sep 2018 15:23:49 +0000 (15:23 +0000)
The default cachemgr.conf contains three lines other than
comments. Two of them are blank, the third is "localhost".
These blank lines show up in the "Cache Server" list in the
CGI output.

tools/cachemgr.cc

index f99dcae7c7efbdaaae2d2f0eee5a167ce798c78f..b020ca015dca6bcc0c999110516c99419f8712f2 100644 (file)
@@ -294,7 +294,8 @@ auth_html(const char *host, int port, const char *user_name)
 
         while (fgets(config_line, BUFSIZ, fp)) {
             char *server, *comment;
-            strtok(config_line, "\r\n");
+            if (strtok(config_line, "\r\n") == nullptr)
+                continue;
 
             if (config_line[0] == '#')
                 continue;