# HG changeset patch # User Bruno Haible # Date 1161260566 0 # Node ID c15258519e7c8370f069f50316e9fa1f836cd608 # Parent 1bff9b08bea3256f33bf9e50226f6c9dc626b16b Avoid a gcc warning. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-10-18 Bruno Haible + + * lib/findprog.c (find_in_path): Avoid "gcc -Wwrite-strings" warning. + 2006-10-19 Paul Eggert * lib/xstrtol.h: Include gettext.h. diff --git a/lib/findprog.c b/lib/findprog.c --- a/lib/findprog.c +++ b/lib/findprog.c @@ -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';