[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bugs in GNU date (sh-utils package)
From: |
Jim Meyering |
Subject: |
Re: Bugs in GNU date (sh-utils package) |
Date: |
09 Apr 2001 10:39:29 +0200 |
User-agent: |
Gnus/5.090001 (Oort Gnus v0.01) Emacs/21.0.102 |
Hi David,
Thanks for the patch.
That bug was still in the latest test release.
I've applied it.
And thanks to Hon-Yin for the report.
"David J. MacKenzie" <address@hidden> wrote:
...
| The bug you've reported is in this calculation in get_date():
| if (yyHaveDay && !yyHaveDate)
| {
| tm.tm_mday += ((yyDayNumber - tm.tm_wday + 7) % 7
| + 7 * (yyDayOrdinal - (0 < yyDayOrdinal)));
| Start = mktime (&tm);
| if (Start == (time_t) -1)
| return Start;
| }
| Here, yyDayNumber is 0-6 and yyDayOrdinal is -1, which is what "last"
translates to
| in the lexer. mktime() has already been called at least once, setting
tm.tm_isdst,
| but now we're changing the day so we need to reset it to -1 meaning unknown.
|
| The fix is:
|
| --- getdate.y.save Sat Aug 7 05:39:05 1999
| +++ getdate.y Wed Apr 4 20:49:09 2001
| @@ -998,6 +998,7 @@
| {
| tm.tm_mday += ((yyDayNumber - tm.tm_wday + 7) % 7
| + 7 * (yyDayOrdinal - (0 < yyDayOrdinal)));
| + tm.tm_isdst = -1;
| Start = mktime (&tm);
| if (Start == (time_t) -1)
| return Start;
|
|