]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Gonzalo Arana <gonzalo.arana@gmail.com>
authoramosjeffries <>
Tue, 26 Feb 2008 06:26:10 +0000 (06:26 +0000)
committeramosjeffries <>
Tue, 26 Feb 2008 06:26:10 +0000 (06:26 +0000)
Bug #2180 (update) - include minor issues

Use strtok_r() instead of hacking around strtok() problems.

src/cache_cf.cc

index 372af2b04e440de3524f5ae6fa901d841b25eda3..86f2bb9cfd6a759270454296bceb5e55679be530 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.cc,v 1.528.2.2 2008/02/25 23:25:25 amosjeffries Exp $
+ * $Id: cache_cf.cc,v 1.528.2.3 2008/02/25 23:26:10 amosjeffries Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -209,12 +209,11 @@ static int
 parseManyConfigFiles(char* files, int depth)
 {
     int error_count = 0;
-    char* tmp = files;
-    char* file = strtok(tmp, w_space);
+    char* saveptr = NULL;
+    char* file = strtok_r(tmp, w_space, &saveptr);
     while (file != NULL) {
-        tmp += strlen(file) +1;
         error_count += parseOneConfigFile(file, depth);
-        file = strtok(tmp, w_space);
+        file = strtok_r(tmp, w_space, &saveptr);
     }
     return error_count;
 }