|
From: | Glaudiston Gomes da Silva |
Subject: | Re: [bug-gawk] gawk with dates before 1970 |
Date: | Fri, 10 Apr 2015 06:38:39 -0300 |
> From: Glaudiston Gomes da Silva <address@hidden>
> Date: Thu, 9 Apr 2015 15:25:33 -0300
>
> So I looked in source file and commented out the 2 lines that test if is
> negative and make it fatal.
> 1701,1702c1701,1702
> glaudiston:/sources/gawk-4.1.1c$ diff builtin.c.orig builtin.c
> 1916,1917c1916,1917
> < if (clock_val < 0)
> < fatal(_("strftime: second argument less than 0 or too big for time_t"));
> ---
> > //if (clock_val < 0)
> > // fatal(_("strftime: second argument less than 0 or too big for time_t"));
>
> And it worked like magic:
> glaudiston:/sources/gawk-4.1.1c$ ./gawk 'BEGIN{t=mktime("1960 01 01 00 00 00");
> print t; print strftime("%Y-%m-%d", t) }'
> -315608400
> 1960-01-01
>
> 3 questions:
> 1) Why do exists this 2 lines?
> 2) Can my change break anything else?
> 3) If is not a dangerous change, there is any reason to do not add this to the
> next main release code ?
You cannot just delete those lines, because some systems have time_t
as an unsigned data type.
[Prev in Thread] | Current Thread | [Next in Thread] |