Mercurial > gnulib
changeset 27218:6e14b1970790
Avoid a gcc warning.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Thu, 19 Oct 2006 12:22:46 +0000 |
parents | 3309e733ac38 |
children | 47a9e8e8d863 |
files | ChangeLog lib/findprog.c |
diffstat | 2 files changed, 9 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Thu Oct 19 07:51:14 2006 +0000 +++ b/ChangeLog Thu Oct 19 12:22:46 2006 +0000 @@ -1,3 +1,7 @@ +2006-10-18 Bruno Haible <bruno@clisp.org> + + * lib/findprog.c (find_in_path): Avoid "gcc -Wwrite-strings" warning. + 2006-10-19 Paul Eggert <eggert@cs.ucla.edu> * lib/xstrtol.h: Include gettext.h.
--- a/lib/findprog.c Thu Oct 19 07:51:14 2006 +0000 +++ b/lib/findprog.c Thu Oct 19 12:22:46 2006 +0000 @@ -42,7 +42,7 @@ #else /* Unix */ char *path; - char *dir; + char *path_rest; char *cp; if (strchr (progname, '/') != NULL) @@ -58,13 +58,15 @@ /* Make a copy, to prepare for destructive modifications. */ path = xstrdup (path); - for (dir = path; ; dir = cp + 1) + for (path_rest = path; ; path_rest = cp + 1) { + const char *dir; bool last; char *progpathname; /* Extract next directory in PATH. */ - for (cp = dir; *cp != '\0' && *cp != ':'; cp++) + dir = path_rest; + for (cp = path_rest; *cp != '\0' && *cp != ':'; cp++) ; last = (*cp == '\0'); *cp = '\0';