projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
580c614
)
Avoid a gcc warning.
author
Bruno Haible
<bruno@clisp.org>
Thu, 19 Oct 2006 12:22:46 +0000
(12:22 +0000)
committer
Bruno Haible
<bruno@clisp.org>
Thu, 19 Oct 2006 12:22:46 +0000
(12:22 +0000)
ChangeLog
patch
|
blob
|
history
lib/findprog.c
patch
|
blob
|
history
diff --git
a/ChangeLog
b/ChangeLog
index b4a60529d02e891aff665b6dda5444a108c1b167..a9b20cb592afde834355540638ed3e205856b32a 100644
(file)
--- a/
ChangeLog
+++ b/
ChangeLog
@@
-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.
2006-10-19 Paul Eggert <eggert@cs.ucla.edu>
* lib/xstrtol.h: Include gettext.h.
diff --git
a/lib/findprog.c
b/lib/findprog.c
index 568c934858a3fe09d305098484428dc4d7f23a7c..1535dcef0427bcaf2b02666d4560624374dcbc85 100644
(file)
--- a/
lib/findprog.c
+++ b/
lib/findprog.c
@@
-42,7
+42,7
@@
find_in_path (const char *progname)
#else
/* Unix */
char *path;
#else
/* Unix */
char *path;
- char *
dir
;
+ char *
path_rest
;
char *cp;
if (strchr (progname, '/') != NULL)
char *cp;
if (strchr (progname, '/') != NULL)
@@
-58,13
+58,15
@@
find_in_path (const char *progname)
/* Make a copy, to prepare for destructive modifications. */
path = xstrdup (path);
/* 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. */
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';
;
last = (*cp == '\0');
*cp = '\0';