[Toybox] RFC: another stab at date.c.

enh enh at google.com
Tue Mar 28 13:58:32 PDT 2017


that will fail at least one of the tests (Feb 29th in a non-leap
year), but i don't think i really care about that. the case i care
about is not accepting ridiculous input. the chances of any given
seconds-since-1970 passing all these tests seems basically zero, so
that should be fine.

On Tue, Mar 28, 2017 at 1:51 PM, Rob Landley <rob at landley.net> wrote:
> There was a thread back in January where I tried to figure out why %s
> wasn't working in date -D, which resulted in me being mad at mktime and
> strptime for being stupidly designed, petering out around here:
>
> http://lists.landley.net/pipermail/toybox-landley.net/2017-January/008829.html
>
> Along the way, a problem I hit (repeatedly) was that chkmktime() is
> really brittle, most recently that timezones can drive it nuts.
>
> Here's the patch I have lying around to remove chkmktime and instead
> just check the posix boundaries required by
> http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/time.h.html but
> I dunno if that fixes Elliott's original reasons for adding chkmktime in
> the first place.
>
> Opinions?
>
> Rob
>
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net
>



-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.


More information about the Toybox mailing list