summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>1996-05-04 07:43:26 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>1996-05-04 07:43:26 +0000
commitdf61011e9851d42f82fc13d5be2e521333e4caad (patch)
tree095710bf8597a19b729fcc73d0959ea797c1fa02 /gnu
parentf954c30696031a916f767e57bf4899449707d79d (diff)
Actually declare and initialize nowtime... Oops.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/cvs/lib/getdate.y13
1 files changed, 9 insertions, 4 deletions
diff --git a/gnu/usr.bin/cvs/lib/getdate.y b/gnu/usr.bin/cvs/lib/getdate.y
index f538ef4237e..57871426745 100644
--- a/gnu/usr.bin/cvs/lib/getdate.y
+++ b/gnu/usr.bin/cvs/lib/getdate.y
@@ -902,25 +902,30 @@ get_date(p, now)
struct timeb ftz;
time_t Start;
time_t tod;
+ time_t nowtime;
yyInput = p;
if (now == NULL) {
now = &ftz;
- (void)time(&ftz.time);
+ (void)time (&nowtime);
- if (! (tm = gmtime (&ftz.time)))
+ if (! (tm = gmtime (&nowtime)))
return -1;
gmt = *tm; /* Make a copy, in case localtime modifies *tm. */
- if (! (tm = localtime (&ftz.time)))
+ if (! (tm = localtime (&nowtime)))
return -1;
ftz.timezone = difftm (&gmt, tm) / 60;
if(tm->tm_isdst)
ftz.timezone += 60;
}
+ else
+ {
+ nowtime = now->time;
+ }
- tm = localtime(&now->time);
+ tm = localtime(&nowtime);
yyYear = tm->tm_year;
yyMonth = tm->tm_mon + 1;
yyDay = tm->tm_mday;