summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/entries.c
diff options
context:
space:
mode:
authorJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-08-13 12:47:55 +0000
committerJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-08-13 12:47:55 +0000
commit1005ac4d4afab2b8fea1c137024bafb4a1c5e6f9 (patch)
tree3314abfb2206a31211551256dfca0c5b00ff69a3 /usr.bin/cvs/entries.c
parentb97b96819946de923c0f3bcc7985696750636ff6 (diff)
Ditch the 'ce_timestamp' field in favor of 'ce_mtime', which keeps
the timestamp in time_t instead of a string
Diffstat (limited to 'usr.bin/cvs/entries.c')
-rw-r--r--usr.bin/cvs/entries.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c
index e9c0ebdd4d9..3a65db2a662 100644
--- a/usr.bin/cvs/entries.c
+++ b/usr.bin/cvs/entries.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: entries.c,v 1.12 2004/08/12 18:33:47 jfb Exp $ */
+/* $OpenBSD: entries.c,v 1.13 2004/08/13 12:47:54 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -366,7 +366,7 @@ cvs_ent_parse(const char *entry)
if (entp->ce_type == CVS_ENT_FILE) {
rcsnum_aton(fields[2], NULL, entp->ce_rev);
- entp->ce_timestamp = fields[3];
+ entp->ce_mtime = cvs_datesec(fields[3], CVS_DATE_CTIME, 0);
entp->ce_opts = fields[4];
entp->ce_tag = fields[5];
}
@@ -436,7 +436,8 @@ cvs_ent_getent(const char *path)
int
cvs_ent_write(CVSENTRIES *ef)
{
- char revbuf[64];
+ size_t len;
+ char revbuf[64], timebuf[32];
struct cvs_ent *ent;
if (ef->cef_file == NULL)
@@ -452,8 +453,12 @@ cvs_ent_write(CVSENTRIES *ef)
putc('D', ef->cef_file);
rcsnum_tostr(ent->ce_rev, revbuf, sizeof(revbuf));
+ ctime_r(&(ent->ce_mtime), timebuf);
+ len = strlen(timebuf);
+ if ((len > 0) && (timebuf[len - 1] == '\n'))
+ timebuf[--len] = '\0';
fprintf(ef->cef_file, "/%s/%s/%s/%s/%s\n", ent->ce_name,
- revbuf, ent->ce_timestamp, "", "");
+ revbuf, timebuf, "", "");
}
/* terminating line */