Subject: [htdig3-dev] Y2K patch
From: Warren Jones (wjones@tc.fluke.com)
Date: Wed Jan 05 2000 - 20:22:55 PST
I have to deal with a web server that returns dates with a two
digit year field. Debugging output from htdig version 3.1.4
looks like this:
Header line: Last-modified: Thursday, 06-Jan-00 00:12:52 GMT
Translated Thursday, 06-Jan-00 00:12:52 GMT to 06 Jan 1900 00:12:52 (0)
And converted to Wed, 31 Dec 1969 23:59:59 ^^^^
bogosity
I know the web server is broken, but I'm not in a position to fix it.
Hope the following patch to strptime.cc will help others in the
same situation.
-- Warren Jones M/S 279F wjones@tc.fluke.com Fluke Corporation phone: (425) 356-5934 PO Box 9090, Everett, WA, USA 98206-9090 Fax: (425) 356-5043Index: strptime.cc =================================================================== RCS file: /home/wjones/src/CVS.repo/htdig/htlib/strptime.cc,v retrieving revision 1.1.1.1 diff -c -r1.1.1.1 strptime.cc *** strptime.cc 1997/01/17 20:35:38 1.1.1.1 --- strptime.cc 2000/01/06 04:00:09 *************** *** 348,353 **** --- 348,355 ---- i *= 10; i += *buf - '0'; } + if (c == 'y' && i<70) // Y2K windowing kludge + i += 100; if (c == 'Y') i -= 1900; if (i < 0)
------------------------------------ To unsubscribe from the htdig3-dev mailing list, send a message to htdig3-dev-unsubscribe@htdig.org You will receive a message to confirm this.
This archive was generated by hypermail 2b28 : Wed Jan 05 2000 - 20:38:21 PST