From c31616aeab6057c514537259fdeb600422f7adad Mon Sep 17 00:00:00 2001 From: wessels <> Date: Wed, 25 Jun 2003 02:53:39 +0000 Subject: [PATCH] In parseEtcHosts(), using strtok() to strip comments does not work if the first character is a comment. The buf[0] check is still necessary. --- src/tools.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.47.2