diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2008-02-10 10:21:43 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2008-02-10 10:21:43 +0000 |
commit | 1bfb3f5f69f5d677b26511780bfa077d36bd6a80 (patch) | |
tree | 50d0e3846c744fba8e58033e73455f3b32b11fc7 /usr.bin/cvs/entries.c | |
parent | 8b60bdfd121637f6e89639e4fe4264cb8f430756 (diff) |
properly initialize cvs_specified_date so we dont end up with
random stuff going on
Diffstat (limited to 'usr.bin/cvs/entries.c')
-rw-r--r-- | usr.bin/cvs/entries.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c index 03cbe878b9f..cc751d8403a 100644 --- a/usr.bin/cvs/entries.c +++ b/usr.bin/cvs/entries.c @@ -1,4 +1,4 @@ -/* $OpenBSD: entries.c,v 1.91 2008/02/10 10:10:15 joris Exp $ */ +/* $OpenBSD: entries.c,v 1.92 2008/02/10 10:21:42 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -137,6 +137,8 @@ cvs_ent_parse(const char *entry) ent->ce_status = CVS_ENT_REG; ent->ce_name = fields[1]; ent->ce_rev = NULL; + ent->ce_date = -1; + ent->ce_tag = NULL; if (ent->ce_type == CVS_ENT_FILE) { if (*fields[2] == '-') { @@ -202,8 +204,7 @@ cvs_ent_parse(const char *entry) default: fatal("invalid sticky entry"); } - } else - ent->ce_tag = NULL; + } return (ent); } @@ -445,7 +446,7 @@ cvs_parse_tagfile(char *dir, char **tagp, char **datep, int *nbp) datetm.tm_year -= 1900; datetm.tm_mon -= 1; - if (cvs_specified_date == 0) + if (cvs_specified_date == -1) cvs_specified_date = timegm(&datetm); if (datep != NULL) @@ -487,7 +488,7 @@ cvs_write_tagfile(const char *dir, char *tag, char *date) if (i < 0 || i >= MAXPATHLEN) return; - if (tag != NULL || cvs_specified_date != 0) { + if (tag != NULL || cvs_specified_date != -1) { if ((fp = fopen(tagpath, "w+")) == NULL) { if (errno != ENOENT) { cvs_log(LP_NOTICE, "failed to open `%s' : %s", |