From: Amos Jeffries Date: Wed, 5 Sep 2018 15:23:45 +0000 (+0000) Subject: Bug 4716: Blank lines in cachemgr.conf are not skipped (#274) X-Git-Tag: M-staged-PR274 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c202be8a6afcc684f854bb33d5d7890360cb08bd;p=thirdparty%2Fsquid.git Bug 4716: Blank lines in cachemgr.conf are not skipped (#274) 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. --- diff --git a/tools/cachemgr.cc b/tools/cachemgr.cc index f99dcae7c7..b020ca015d 100644 --- a/tools/cachemgr.cc +++ b/tools/cachemgr.cc @@ -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;