From: wessels <> Date: Thu, 8 Jan 1998 05:45:23 +0000 (+0000) Subject: From: Arjan de Vet X-Git-Tag: SQUID_3_0_PRE1~4227 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72367f907b78c8d791ae360ec6b863558e19ae22;p=thirdparty%2Fsquid.git From: Arjan de Vet Year-2000 (Y2K) fixes --- diff --git a/lib/rfc1123.c b/lib/rfc1123.c index 85d51a5052..cc207895cc 100644 --- a/lib/rfc1123.c +++ b/lib/rfc1123.c @@ -1,6 +1,6 @@ /* - * $Id: rfc1123.c,v 1.12 1998/01/05 00:57:53 wessels Exp $ + * $Id: rfc1123.c,v 1.13 1998/01/07 22:45:23 wessels Exp $ * * DEBUG: * AUTHOR: Harvest Derived @@ -193,6 +193,12 @@ parse_rfc1123(const char *str) tm.tm_mday = make_num(s); tm.tm_mon = make_month(s + 3); tm.tm_year = make_num(s + 7); + /* + * Y2K: Arjan de Vet + * if tm.tm_year < 70, assume it's after the year 2000. + */ + if (tm.tm_year < 70) + tm.tm_year += 100; tm.tm_hour = make_num(s + 10); tm.tm_min = make_num(s + 13); tm.tm_sec = make_num(s + 16); diff --git a/src/cachemgr.cc b/src/cachemgr.cc index b33acd1b74..e189eef16c 100644 --- a/src/cachemgr.cc +++ b/src/cachemgr.cc @@ -1,6 +1,6 @@ /* - * $Id: cachemgr.cc,v 1.65 1997/11/12 23:36:23 wessels Exp $ + * $Id: cachemgr.cc,v 1.66 1998/01/07 22:45:25 wessels Exp $ * * DEBUG: section 0 CGI Cache Manager * AUTHOR: Harvest Derived @@ -317,16 +317,10 @@ static char *describeTimeSince(time_t then); static void print_trailer(void) { - static char tbuf[128]; - struct tm *gmt; - - gmt = gmtime(&now); - strftime(tbuf, 128, "%A, %d-%b-%y %H:%M:%S GMT", gmt); - printf("
\n"); printf("
\n"); printf("Generated %s, by %s/%s@%s\n", - tbuf, progname, SQUID_VERSION, getfullhostname()); + mkrfc1123(now), progname, SQUID_VERSION, getfullhostname()); printf("
\n"); } diff --git a/src/debug.cc b/src/debug.cc index b05ccb3131..5d1ffdbe1f 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -1,6 +1,6 @@ /* - * $Id: debug.cc,v 1.55 1998/01/05 21:44:40 wessels Exp $ + * $Id: debug.cc,v 1.56 1998/01/07 22:45:25 wessels Exp $ * * DEBUG: section 0 Debug Routines * AUTHOR: Harvest Derived @@ -290,7 +290,7 @@ accessLogTime(time_t t) static time_t last_t = 0; if (t != last_t) { tm = localtime(&t); - strftime(buf, 127, "%y/%m/%d %H:%M:%S", tm); + strftime(buf, 127, "%Y/%m/%d %H:%M:%S", tm); last_t = t; } return buf;