version 1.21, 2003/07/28 19:05:26 |
version 1.22, 2003/07/29 20:10:17 |
|
|
#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. */ |
|
|
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)) |
|
|
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. */ |