summaryrefslogtreecommitdiff
path: root/usr.bin/rcs
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/rcs')
-rw-r--r--usr.bin/rcs/ci.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/rcs/ci.c b/usr.bin/rcs/ci.c
index 4db9f0d60e4..5cf76cf6041 100644
--- a/usr.bin/rcs/ci.c
+++ b/usr.bin/rcs/ci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ci.c,v 1.96 2006/02/16 16:43:45 niallo Exp $ */
+/* $OpenBSD: ci.c,v 1.97 2006/02/16 17:30:46 niallo Exp $ */
/*
* Copyright (c) 2005 Niall O'Higgins <niallo@openbsd.org>
* All rights reserved.
@@ -582,10 +582,18 @@ checkin_init(struct checkin_params *pb)
}
rcs_desc_set(pb->file, rcs_desc);
+ /*
+ * Set the date of the revision to be the last modification
+ * time of the working file if -d has no argument.
+ */
+ if (pb->date == DATE_MTIME
+ && (checkin_mtimedate(pb) < 0))
+ return (-1);
+
/* Now add our new revision */
if (rcs_rev_add(pb->file,
(pb->newrev == NULL ? RCS_HEAD_REV : pb->newrev),
- LOG_INIT, -1, pb->author) != 0) {
+ LOG_INIT, pb->date, pb->author) != 0) {
cvs_log(LP_ERR, "failed to add new revision");
return (-1);
}