Re: [bug #21455] date --date "" "+test" fails ONLY WITHIN CERTAIN TIME P
From:
Jim Meyering
Subject:
Re: [bug #21455] date --date "" "+test" fails ONLY WITHIN CERTAIN TIME PERIOD #$%^%
Date:
Thu, 01 Nov 2007 01:14:03 +0100
Paul Eggert <address@hidden> wrote:
> Jim Meyering <address@hidden> writes:
>
>> * lib/getdate.y (get_date): Once any isspace or TZ= prefix is consumed,
>> if the remaining date string (to be parsed) is empty, use "0".
>
> Sheesh, and I was trying to look at getdate's guts, which is a big mistake.
> Thanks for the patch; it's much simpler.
I've pushed it.
FYI, I started by comparing ltrace output from these commands
(thanks to Phil for the clock_gettime replacement):
TZ=Europe/Paris LD_PRELOAD=./clock_gettime.so FAKETIME=1193533200 \
diff -u <(ltrace ./date -d '' 2>&1) \
<(ltrace ./date -d 0 2>&1)
That suggested early mktime results differed.
Then debug each and see where/why the mktime inputs diverged:
TZ=Europe/Paris LD_PRELOAD=./clock_gettime.so FAKETIME=1193533200 \
gdb --args ./date -d ''
TZ=Europe/Paris LD_PRELOAD=./clock_gettime.so FAKETIME=1193533200 \
gdb --args ./date -d 0