[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.21 and 1.22

version 1.21, 2003/07/28 19:05:26 version 1.22, 2003/07/29 20:10:17
Line 21 
Line 21 
 #include "common.h"  #include "common.h"
 #include "util.h"  #include "util.h"
 #include "backupfile.h"  #include "backupfile.h"
   #include "pathnames.h"
   
   
 /* Rename a file, copying it if necessary. */  /* Rename a file, copying it if necessary. */
Line 307 
Line 308 
                         return; /* nothing to be done */                          return; /* nothing to be done */
                 *s = '\0';                  *s = '\0';
         }          }
         strlcpy(buf, "/bin/mkdir -p ", sizeof buf);          if (snprintf(buf, sizeof(buf), "%s -p %s", _PATH_MKDIR, tmpbuf)
         if (strlcat(buf, tmpbuf, sizeof(buf)) >= sizeof(buf))              >= sizeof(buf))
                 fatal("buffer too small to hold %.20s...\n", tmpbuf);                  fatal("buffer too small to hold %.20s...\n", tmpbuf);
   
         if (system(buf))          if (system(buf))
Line 332 
Line 333 
         if (debug & 128)          if (debug & 128)
                 say("fetchname %s %d %d\n", at, strip_leading, assume_exists);                  say("fetchname %s %d %d\n", at, strip_leading, assume_exists);
 #endif  #endif
         if (strnEQ(at, "/dev/null", 9)) /* so files can be created by diffing */          /* So files can be created by diffing against /dev/null.  */
                 return NULL;    /* against /dev/null. */          if (strnEQ(at, _PATH_DEVNULL, sizeof(_PATH_DEVNULL) - 1))
                   return NULL;
         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. */

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22