diff options
author | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2004-08-13 13:24:14 +0000 |
---|---|---|
committer | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2004-08-13 13:24:14 +0000 |
commit | e39c670f609437ec1c5b3351714474ba84a3c50e (patch) | |
tree | 702a25ed2412f4d9abcc865a9bead576505e4a15 /usr.bin/cvs/entries.c | |
parent | 8c9080e23019e7f4f49236906df265e82e1d9619 (diff) |
* add an entry for directories when we create them
* when writing a directory entry, skip the revision and timestamp
Diffstat (limited to 'usr.bin/cvs/entries.c')
-rw-r--r-- | usr.bin/cvs/entries.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c index 2c69c9831dc..11dfcd0649a 100644 --- a/usr.bin/cvs/entries.c +++ b/usr.bin/cvs/entries.c @@ -1,4 +1,4 @@ -/* $OpenBSD: entries.c,v 1.14 2004/08/13 12:58:44 jfb Exp $ */ +/* $OpenBSD: entries.c,v 1.15 2004/08/13 13:24:13 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -449,18 +449,24 @@ cvs_ent_write(CVSENTRIES *ef) /* reposition ourself at beginning of file */ rewind(ef->cef_file); TAILQ_FOREACH(ent, &(ef->cef_ent), ce_list) { - if (ent->ce_type == CVS_ENT_DIR) + if (ent->ce_type == CVS_ENT_DIR) { putc('D', ef->cef_file); + timebuf[0] = '\0'; + revbuf[0] = '\0'; + } + else { + rcsnum_tostr(ent->ce_rev, revbuf, sizeof(revbuf)); + 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'; + } + } - rcsnum_tostr(ent->ce_rev, revbuf, sizeof(revbuf)); - - 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'; fprintf(ef->cef_file, "/%s/%s/%s/%s/%s\n", ent->ce_name, revbuf, timebuf, "", ""); } |