summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-08-13 12:58:45 +0000
committerJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-08-13 12:58:45 +0000
commitbd3b8659ff3a01d5debf775e46353ff410de76e5 (patch)
treea42c2381441c31337711d3b6cd75a9a6bf6707a4
parent37ec740fb2265df7c20113bede83ad1a9bb3dae7 (diff)
When the mtime is (time_t)-1, print the dummy timestamp string instead
of a bogus date
-rw-r--r--usr.bin/cvs/entries.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c
index 3a65db2a662..2c69c9831dc 100644
--- a/usr.bin/cvs/entries.c
+++ b/usr.bin/cvs/entries.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: entries.c,v 1.13 2004/08/13 12:47:54 jfb Exp $ */
+/* $OpenBSD: entries.c,v 1.14 2004/08/13 12:58:44 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -453,7 +453,11 @@ cvs_ent_write(CVSENTRIES *ef)
putc('D', ef->cef_file);
rcsnum_tostr(ent->ce_rev, revbuf, sizeof(revbuf));
- ctime_r(&(ent->ce_mtime), timebuf);
+
+ if (ent->ce_mtime == CVS_DATE_DMSEC)
+ strlcpy(timebuf, CVS_DATE_DUMMY, sizeof(timebuf));
+ else
+ ctime_r(&(ent->ce_mtime), timebuf);
len = strlen(timebuf);
if ((len > 0) && (timebuf[len - 1] == '\n'))
timebuf[--len] = '\0';