summaryrefslogtreecommitdiff
path: root/usr.bin/rcs
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2006-03-21 02:45:10 +0000
committerRay Lai <ray@cvs.openbsd.org>2006-03-21 02:45:10 +0000
commit77f7e399bc91f19e09f9398ae212bae5d52a7174 (patch)
tree5ee358aec054e4ed4642f9cf8f2f489862bd87c7 /usr.bin/rcs
parent85a0ab54e4aa2331927856b3707089ed33e95544 (diff)
Allow creation of an RCS file if RCS_CREATE flag set.
OK xsa@
Diffstat (limited to 'usr.bin/rcs')
-rw-r--r--usr.bin/rcs/rcsprog.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/rcs/rcsprog.c b/usr.bin/rcs/rcsprog.c
index 2ab634b118c..9822714f011 100644
--- a/usr.bin/rcs/rcsprog.c
+++ b/usr.bin/rcs/rcsprog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsprog.c,v 1.79 2006/03/20 17:41:37 xsa Exp $ */
+/* $OpenBSD: rcsprog.c,v 1.80 2006/03/21 02:45:09 ray Exp $ */
/*
* Copyright (c) 2005 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -362,8 +362,8 @@ rcs_statfile(char *fname, char *out, size_t len)
if ((rcspath = rcs_choosefile(fname)) == NULL)
fatal("rcs_statfile: path truncation");
- /* File not found. */
- if (stat(rcspath, &st) == -1) {
+ /* Error out if file not found and we are not creating one. */
+ if (stat(rcspath, &st) == -1 && !(rcsflags & RCS_CREATE)) {
if ((strcmp(__progname, "rcsclean") != 0)
&& (strcmp(__progname, "ci") != 0))
cvs_log(LP_ERRNO, "%s", rcspath);