diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2006-04-29 04:42:48 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2006-04-29 04:42:48 +0000 |
commit | d6dd4390b461cf1494153c9bd5705fff78ae54c1 (patch) | |
tree | 556efe4190320bc4832a26c8683d25c30b3c65a1 /usr.bin/cvs | |
parent | 9d0d597c5fd4a1fd6d3c85fe177f7b36e39d5082 (diff) |
Remove dead code.
OK niallo@
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/date.y | 50 |
1 files changed, 21 insertions, 29 deletions
diff --git a/usr.bin/cvs/date.y b/usr.bin/cvs/date.y index e087c939cc0..722df234635 100644 --- a/usr.bin/cvs/date.y +++ b/usr.bin/cvs/date.y @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: date.y,v 1.11 2006/01/02 08:11:56 xsa Exp $ */ +/* $OpenBSD: date.y,v 1.12 2006/04/29 04:42:46 ray Exp $ */ /* ** Originally written by Steven M. Bellovin <smb@research.att.com> while @@ -814,42 +814,34 @@ difftm(struct tm *a, struct tm *b) time_t cvs_date_parse(const char *p) { - struct tm *tm, gmt; + struct tm gmt, *gmt_ptr, *tm; struct timeb ftz, *now; time_t Start, tod, nowtime; - now = NULL; - yyInput = p; - if (now == NULL) { - struct tm *gmt_ptr; - - now = &ftz; - (void)time(&nowtime); - - gmt_ptr = gmtime(&nowtime); - if (gmt_ptr != NULL) { - /* Make a copy, in case localtime modifies *tm (I think - * that comment now applies to *gmt_ptr, but I am too - * lazy to dig into how gmtime and locatime allocate the - * structures they return pointers to). - */ - gmt = *gmt_ptr; - } - if (!(tm = localtime(&nowtime))) - return (-1); + now = &ftz; + (void)time(&nowtime); - if (gmt_ptr != NULL) - ftz.timezone = difftm(&gmt, tm) / 60; - - if (tm->tm_isdst) - ftz.timezone += 60; - } - else { - nowtime = now->time; + gmt_ptr = gmtime(&nowtime); + if (gmt_ptr != NULL) { + /* Make a copy, in case localtime modifies *tm (I think + * that comment now applies to *gmt_ptr, but I am too + * lazy to dig into how gmtime and locatime allocate the + * structures they return pointers to). + */ + gmt = *gmt_ptr; } + if (!(tm = localtime(&nowtime))) + return (-1); + + if (gmt_ptr != NULL) + ftz.timezone = difftm(&gmt, tm) / 60; + + if (tm->tm_isdst) + ftz.timezone += 60; + tm = localtime(&nowtime); yyYear = tm->tm_year + 1900; yyMonth = tm->tm_mon + 1; |