]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Make sure the separator is restored when scan_colsep exits early. This
authorTom Hughes <tom@compton.nu>
Mon, 12 Jul 2004 09:35:37 +0000 (09:35 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 12 Jul 2004 09:35:37 +0000 (09:35 +0000)
stops the PATH variable being truncated for programs run under valgrind.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2480

coregrind/vg_main.c

index 14c302b78725e76026c8fe5890876a8754a16f81..7ea690635e38c67be341f3145a22c2a4a41e4119 100644 (file)
@@ -795,8 +795,10 @@ static Bool scan_colsep(char *colsep, Bool (*func)(const char *))
         char save = *cp;
 
         *cp = '\0';
-        if ((*func)(entry))
+        if ((*func)(entry)) {
+            *cp = save;
            return True;
+         }
         *cp = save;
         entry = cp+1;
       }