]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
In parseEtcHosts(), using strtok() to strip comments does not work if
authorwessels <>
Wed, 25 Jun 2003 02:53:39 +0000 (02:53 +0000)
committerwessels <>
Wed, 25 Jun 2003 02:53:39 +0000 (02:53 +0000)
the first character is a comment.  The buf[0] check is still necessary.

src/tools.cc

index 0fe906c9e27922e89657b45ea192736a56c9f7f5..af62dc1bf289154bc59d31403bbd02f5779b8438 100644 (file)
@@ -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;