summaryrefslogtreecommitdiff
path: root/usr.bin/rcs/ci.c
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2006-04-13 03:18:07 +0000
committerJoris Vink <joris@cvs.openbsd.org>2006-04-13 03:18:07 +0000
commit9c9ca1577f6acf58a176f73e0c61ed8c067c0854 (patch)
treefa4f09d844341b0433beeb3ebe36f285c75cce99 /usr.bin/rcs/ci.c
parent891edc76a8224070afd09d82d9105ca00d1d0f54 (diff)
correctly handle RCS files without any revisions;
original diff from ray@, crafted into shape by myself. okay ray@
Diffstat (limited to 'usr.bin/rcs/ci.c')
-rw-r--r--usr.bin/rcs/ci.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/usr.bin/rcs/ci.c b/usr.bin/rcs/ci.c
index d8408bacd0d..77241938217 100644
--- a/usr.bin/rcs/ci.c
+++ b/usr.bin/rcs/ci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ci.c,v 1.141 2006/04/13 00:58:25 ray Exp $ */
+/* $OpenBSD: ci.c,v 1.142 2006/04/13 03:18:06 joris Exp $ */
/*
* Copyright (c) 2005, 2006 Niall O'Higgins <niallo@openbsd.org>
* All rights reserved.
@@ -281,6 +281,12 @@ checkin_main(int argc, char **argv)
NULL)
fatal("invalid revision: %s", rev_str);
+ /* XXX - support for commiting to a file without revisions */
+ if (pb.file->rf_ndelta == 0) {
+ pb.flags |= NEWFILE;
+ pb.file->rf_flags |= RCS_CREATE;
+ }
+
if (pb.flags & NEWFILE)
status = checkin_init(&pb);
else
@@ -661,6 +667,9 @@ checkin_init(struct checkin_params *pb)
checkin_keywordscan(filec, &pb->newrev, &pb->date, &pb->state,
&pb->author);
+ if (pb->file->rf_ndelta == 0)
+ goto skipdesc;
+
/* Get description from user */
if (pb->description == NULL)
rcs_desc = (const char *)checkin_getdesc();
@@ -682,6 +691,8 @@ checkin_init(struct checkin_params *pb)
}
rcs_desc_set(pb->file, rcs_desc);
+skipdesc:
+
/*
* If the user had specified a zero-ending revision number e.g. 4
* emulate odd GNU behaviour and fetch log message.