diff options
author | 2006-03-15 02:46:14 +0000 | |
---|---|---|
committer | 2006-03-15 02:46:14 +0000 | |
commit | b2ad55c7f61373bf34b953fb7e0103f13a5e5432 (patch) | |
tree | d61944c2fe47fc32429f4dd76b181d1596ac825b /usr.bin/rcs/rcsprog.c | |
parent | Fix and enable rcsmerge test. (diff) | |
download | wireguard-openbsd-b2ad55c7f61373bf34b953fb7e0103f13a5e5432.tar.xz wireguard-openbsd-b2ad55c7f61373bf34b953fb7e0103f13a5e5432.zip |
Don't assume there is an RCS directory just because the filename
contains the letters `RCS'.
ok niallo
Diffstat (limited to 'usr.bin/rcs/rcsprog.c')
-rw-r--r-- | usr.bin/rcs/rcsprog.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/usr.bin/rcs/rcsprog.c b/usr.bin/rcs/rcsprog.c index bea11281c5e..7cad13ce45d 100644 --- a/usr.bin/rcs/rcsprog.c +++ b/usr.bin/rcs/rcsprog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsprog.c,v 1.72 2006/03/14 03:33:30 ray Exp $ */ +/* $OpenBSD: rcsprog.c,v 1.73 2006/03/15 02:46:14 ray Exp $ */ /* * Copyright (c) 2005 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -230,17 +230,13 @@ rcs_getopt(int argc, char **argv, const char *optstr) int rcs_statfile(char *fname, char *out, size_t len) { - int found, strdir; + int found; char defaultsuffix[] = RCS_DEFAULT_SUFFIX; char filev[MAXPATHLEN], fpath[MAXPATHLEN]; char *ext, *slash; struct stat st; - strdir = found = 0; - - /* we might have gotten the RCS/ dir in the argument string */ - if (strstr(fname, RCSDIR) != NULL) - strdir = 1; + found = 0; if (rcs_suffixes != NULL) ext = rcs_suffixes; @@ -266,8 +262,7 @@ rcs_statfile(char *fname, char *out, size_t len) strlcat(filev, ext, sizeof(filev)) >= sizeof(filev)) fatal("rcs_statfile: path truncation"); - if ((strdir == 0) && - (stat(RCSDIR, &st) != -1) && (st.st_mode & S_IFDIR)) { + if (stat(RCSDIR, &st) != -1 && (st.st_mode & S_IFDIR)) { if (strlcpy(fpath, RCSDIR, sizeof(fpath)) >= sizeof(fpath) || strlcat(fpath, "/", |