From ff18dafa045c6fa286018a40158122c68f840dbe Mon Sep 17 00:00:00 2001 From: Niall O'Higgins Date: Thu, 16 Feb 2006 17:30:47 +0000 Subject: - ensure we handle -d properly in initial revision, not just updates. --- usr.bin/rcs/ci.c | 12 ++++++++++-- 1 file 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 * 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); } -- cgit v1.2.3