From: wessels <> Date: Wed, 25 Jun 2003 02:53:39 +0000 (+0000) Subject: In parseEtcHosts(), using strtok() to strip comments does not work if X-Git-Tag: SQUID_3_0_PRE1~82 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c31616aeab6057c514537259fdeb600422f7adad;p=thirdparty%2Fsquid.git In parseEtcHosts(), using strtok() to strip comments does not work if the first character is a comment. The buf[0] check is still necessary. --- diff --git a/src/tools.cc b/src/tools.cc index 0fe906c9e2..af62dc1bf2 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1,6 +1,6 @@ /* - * $Id: tools.cc,v 1.237 2003/06/23 00:41:31 wessels Exp $ + * $Id: tools.cc,v 1.238 2003/06/24 20:53:39 wessels Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -1182,6 +1182,9 @@ parseEtcHosts(void) wordlist *hosts = NULL; char *addr; + if (buf[0] == '#') /* MS-windows likes to add comments */ + continue; + strtok(buf, "#"); /* chop everything following a comment marker */ lt = buf;