summaryrefslogtreecommitdiff
path: root/usr.bin/rcs/rcsprog.c
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2006-05-27 05:49:15 +0000
committerRay Lai <ray@cvs.openbsd.org>2006-05-27 05:49:15 +0000
commit21be1db1b7c2070593e7732c1c3d20c574a7845d (patch)
tree8e2cda7a29306dd5aa527f2feca80a41aa42fc93 /usr.bin/rcs/rcsprog.c
parent43205cef80d4f7ad59a6a71c15a3202e9191ab95 (diff)
Remove rcs_statfile(). It was just a wrapper for rcs_choosefile(),
handling exceptions oddly. OK joris@
Diffstat (limited to 'usr.bin/rcs/rcsprog.c')
-rw-r--r--usr.bin/rcs/rcsprog.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/usr.bin/rcs/rcsprog.c b/usr.bin/rcs/rcsprog.c
index 07aa2a9cfe5..0f58ce68da3 100644
--- a/usr.bin/rcs/rcsprog.c
+++ b/usr.bin/rcs/rcsprog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsprog.c,v 1.127 2006/05/19 07:52:38 xsa Exp $ */
+/* $OpenBSD: rcsprog.c,v 1.128 2006/05/27 05:49:14 ray Exp $ */
/*
* Copyright (c) 2005 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -202,10 +202,14 @@ rcs_main(int argc, char **argv)
while ((ch = rcs_getopt(argc, argv, RCSPROG_OPTSTRING)) != -1) {
switch (ch) {
case 'A':
- ofd = rcs_statfile(rcs_optarg, ofpath,
- sizeof(ofpath), flags);
- if (ofd < 0)
+ /* XXX - Should we process this after all flags? */
+ ofd = rcs_choosefile(rcs_optarg, ofpath,
+ sizeof(ofpath));
+ if (ofd < 0) {
+ if (!(flags & RCS_CREATE))
+ warnx("%s", ofpath);
exit(1);
+ }
rcsflags |= CO_ACLAPPEND;
break;
case 'a':
@@ -303,9 +307,11 @@ rcs_main(int argc, char **argv)
}
for (i = 0; i < argc; i++) {
- fd = rcs_statfile(argv[i], fpath, sizeof(fpath), flags);
- if (fd < 0 && !(flags & RCS_CREATE))
+ fd = rcs_choosefile(argv[i], fpath, sizeof(fpath));
+ if (fd < 0 && !(flags & RCS_CREATE)) {
+ warnx("%s", fpath);
continue;
+ }
if (!(rcsflags & QUIET))
(void)fprintf(stderr, "RCS file: %s\n", fpath);