From: Tom Hughes Date: Mon, 12 Jul 2004 09:35:37 +0000 (+0000) Subject: Make sure the separator is restored when scan_colsep exits early. This X-Git-Tag: svn/VALGRIND_2_1_2~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0856504b275c7d2797ae100dfe5bb6e53ec98f55;p=thirdparty%2Fvalgrind.git Make sure the separator is restored when scan_colsep exits early. This stops the PATH variable being truncated for programs run under valgrind. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2480 --- diff --git a/coregrind/vg_main.c b/coregrind/vg_main.c index 14c302b787..7ea690635e 100644 --- a/coregrind/vg_main.c +++ b/coregrind/vg_main.c @@ -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; }