From df61011e9851d42f82fc13d5be2e521333e4caad Mon Sep 17 00:00:00 2001 From: Thorsten Lockert Date: Sat, 4 May 1996 07:43:26 +0000 Subject: Actually declare and initialize nowtime... Oops. --- gnu/usr.bin/cvs/lib/getdate.y | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'gnu/usr.bin/cvs/lib/getdate.y') 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; -- cgit v1.2.3