version 1.72, 2006/03/14 03:33:30 |
version 1.73, 2006/03/15 02:46:14 |
|
|
int |
int |
rcs_statfile(char *fname, char *out, size_t len) |
rcs_statfile(char *fname, char *out, size_t len) |
{ |
{ |
int found, strdir; |
int found; |
char defaultsuffix[] = RCS_DEFAULT_SUFFIX; |
char defaultsuffix[] = RCS_DEFAULT_SUFFIX; |
char filev[MAXPATHLEN], fpath[MAXPATHLEN]; |
char filev[MAXPATHLEN], fpath[MAXPATHLEN]; |
char *ext, *slash; |
char *ext, *slash; |
struct stat st; |
struct stat st; |
|
|
strdir = found = 0; |
found = 0; |
|
|
/* we might have gotten the RCS/ dir in the argument string */ |
|
if (strstr(fname, RCSDIR) != NULL) |
|
strdir = 1; |
|
|
|
if (rcs_suffixes != NULL) |
if (rcs_suffixes != NULL) |
ext = rcs_suffixes; |
ext = rcs_suffixes; |
else |
else |
|
|
strlcat(filev, ext, sizeof(filev)) >= sizeof(filev)) |
strlcat(filev, ext, sizeof(filev)) >= sizeof(filev)) |
fatal("rcs_statfile: path truncation"); |
fatal("rcs_statfile: path truncation"); |
|
|
if ((strdir == 0) && |
if (stat(RCSDIR, &st) != -1 && (st.st_mode & S_IFDIR)) { |
(stat(RCSDIR, &st) != -1) && (st.st_mode & S_IFDIR)) { |
|
if (strlcpy(fpath, RCSDIR, |
if (strlcpy(fpath, RCSDIR, |
sizeof(fpath)) >= sizeof(fpath) || |
sizeof(fpath)) >= sizeof(fpath) || |
strlcat(fpath, "/", |
strlcat(fpath, "/", |