diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-05-04 07:46:12 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-05-04 07:46:12 +0000 |
commit | 19b42fbd58cb6cf7c355705e05242072137a8590 (patch) | |
tree | 26f8cf4b4891ed8c73de4b6e6a5a6125bf221f53 /gnu/usr.bin/cvs | |
parent | df61011e9851d42f82fc13d5be2e521333e4caad (diff) |
Actually declare and initialize nowtime... Oops.
Diffstat (limited to 'gnu/usr.bin/cvs')
-rw-r--r-- | gnu/usr.bin/cvs/lib/getdate.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gnu/usr.bin/cvs/lib/getdate.c b/gnu/usr.bin/cvs/lib/getdate.c index a9acf1dacbc..b0f9411cabb 100644 --- a/gnu/usr.bin/cvs/lib/getdate.c +++ b/gnu/usr.bin/cvs/lib/getdate.c @@ -721,25 +721,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; |