Article View: news.software.nn
Article #2792bug fix for NN dateline parsing (was: Feature request)
From: Paul Eggert
Date: Fri, 05 Jun 1992 03:04
Date: Fri, 05 Jun 1992 03:04
43 lines
2135 bytes
2135 bytes
garym@telesoft.com (Gary Morris @lone) writes:
>The Date: line is already converted to GMT
>and stored internally (dh_date & t_stamp) in this way for sorting purposes
>(though I suspect a small bug in this conversion).
I was seriously annoyed by the way NN mishandles numeric GMT offsets;
it gets their signs wrong!
Also, NN mishandles non-GMT time zones near short month boundaries.
Here's an unofficial patch to NN 6.4.16 for the former bug;
the latter bug can't easily be fixed,
due to NN's, er, somewhat _unusual_ time stamp encoding.
*** old/pack_date.c Wed Apr 17 01:32:40 1991
--- new/pack_date.c Thu Jun 4 20:03:02 1992
***************
*** 4,9 ****
--- 4,11 ----
* Calculate an approximate "time_stamp" value for a date
* string. The actual value is not at all critical,
* as long as the "ordering" is ok.
+ * The current algorithm mishandles non-GMT time zones near
+ * short month boundaries, but this is rare in real news.
*
* The result is NOT a time_t value, i.e. ctime() will
* not produce the original Date string.
***************
*** 256,262 ****
res *= 24 * 60;
res += (hour * 60) + min;
! return res + tzone(date);
}
--- 258,264 ----
res *= 24 * 60;
res += (hour * 60) + min;
! return res - tzone(date);
}
Technical Details
Message-ID:
<bi!SBcHg@twinsun.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!sparky!uunet!cs.utexas.edu!sdd.hp.com!swrinde!elroy.jpl.nasa.gov!ucla-cs!twinsun!eggertReferences:
<1992May29.213745.9112@Warren.MENTORG.COM> <1992May30.202634.22531@daimi.aau.dk> <1992Jun1.200854.9958@Warren.MENTORG.COM> <1992Jun2.224209.4802@telesoft.com>Show Full Headers
Complete Article Headers
Message-ID: <bi!SBcHg@twinsun.com> Subject: bug fix for NN dateline parsing (was: Feature request) Date: Fri, 05 Jun 1992 03:04:33 +0000 From: eggert@twinsun.com (Paul Eggert) References: <1992May29.213745.9112@Warren.MENTORG.COM> <1992May30.202634.22531@daimi.aau.dk> <1992Jun1.200854.9958@Warren.MENTORG.COM> <1992Jun2.224209.4802@telesoft.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!sparky!uunet!cs.utexas.edu!sdd.hp.com!swrinde!elroy.jpl.nasa.gov!ucla-cs!twinsun!eggert Newsgroups: news.software.nn Sender: usenet@twinsun.com Organization: Twin Sun, Inc Lines: 43 Nntp-Posting-Host: farside