[BACK]Return to util.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / patch

Diff for /src/usr.bin/patch/util.c between version 1.23 and 1.24

version 1.23, 2003/07/30 15:47:54 version 1.24, 2003/07/31 20:51:43
Line 307 
Line 307 
 fetchname(const char *at, int strip_leading, int assume_exists)  fetchname(const char *at, int strip_leading, int assume_exists)
 {  {
         char            *fullname, *name, *t, tmpbuf[200];          char            *fullname, *name, *t, tmpbuf[200];
           int             sleading;
         struct stat     filestat;          struct stat     filestat;
   
         if (at == NULL || *at == '\0')          if (at == NULL || *at == '\0')
Line 323 
Line 324 
         name = fullname = t = savestr(at);          name = fullname = t = savestr(at);
   
         /* Strip off up to `strip_leading' path components and NUL terminate. */          /* Strip off up to `strip_leading' path components and NUL terminate. */
         for (; *t != '\0' && !isspace(*t); t++) {          for (sleading = strip_leading; *t != '\0' && !isspace(*t); t++) {
                 if (t[0] == '/' && t[1] != '/' && t[1] != '\0')                  if (t[0] == '/' && t[1] != '/' && t[1] != '\0')
                         if (--strip_leading >= 0)                          if (--sleading >= 0)
                                 name = t + 1;                                  name = t + 1;
         }          }
         *t = '\0';          *t = '\0';

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24