[Toybox] sort -n -M patch

Rob Landley rob at landley.net
Wed Sep 28 12:08:37 PDT 2016


I'm looking at
https://github.com/landley/toybox/pull/19/commits/6d6252a8f39e3f813cd79dc96ebae61c6507717c
which does 2 things:

1) Hardwire in english month names. Not sure why, since strptime is posix:

http://pubs.opengroup.org/onlinepubs/9699919799/functions/strptime.html

And having libc do it gives us locale-specific translation for free? (I
don't go out of my way for it, but I don't see why I should turn it down
if libc already did the work?)

2) replace 2 lines of floating point comparison code with 18 lines of
floating point comparison code.

I'm aware that this offers unlimited precision (in a way I'd have to
write a lot of corner case tests for; this patch comes with zero new
testcases), I'm just not sure why we need that? Posix sort -n says to
support locale-specific thousands separators, so this can't be for
standards compliance.

I just checked busybox and they have _not_ changed the -n logic I wrote
for them in 2004, which is doing atof() and comparing the results. So
nobody's cared enough over there to fiddle with it in the past dozen
years...

I am leaning towards not accepting either part of this patch.

Rob


More information about the Toybox mailing list