bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tweak findprog.c


From: Bruno Haible
Subject: tweak findprog.c
Date: Thu, 19 Oct 2006 14:20:14 +0200
User-agent: KMail/1.9.1

Hi,

I applied this, to fix a gcc warning.


2006-10-18  Bruno Haible  <address@hidden>

        * lib/findprog.c (find_in_path): Avoid "gcc -Wwrite-strings" warning.

*** gnulib-20061012/lib/findprog.c      2006-09-19 00:51:16.000000000 +0200
--- gnulib-20061012-modified/lib/findprog.c     2006-10-19 02:15:46.000000000 
+0200
***************
*** 42,48 ****
  #else
    /* Unix */
    char *path;
!   char *dir;
    char *cp;
  
    if (strchr (progname, '/') != NULL)
--- 42,48 ----
  #else
    /* Unix */
    char *path;
!   char *path_rest;
    char *cp;
  
    if (strchr (progname, '/') != NULL)
***************
*** 58,70 ****
  
    /* Make a copy, to prepare for destructive modifications.  */
    path = xstrdup (path);
!   for (dir = path; ; dir = cp + 1)
      {
        bool last;
        char *progpathname;
  
        /* Extract next directory in PATH.  */
!       for (cp = dir; *cp != '\0' && *cp != ':'; cp++)
        ;
        last = (*cp == '\0');
        *cp = '\0';
--- 58,72 ----
  
    /* Make a copy, to prepare for destructive modifications.  */
    path = xstrdup (path);
!   for (path_rest = path; ; path_rest = cp + 1)
      {
+       const char *dir;
        bool last;
        char *progpathname;
  
        /* Extract next directory in PATH.  */
!       dir = path_rest;
!       for (cp = path_rest; *cp != '\0' && *cp != ':'; cp++)
        ;
        last = (*cp == '\0');
        *cp = '\0';




reply via email to

[Prev in Thread] Current Thread [Next in Thread]