]> git.ipfire.org Git - thirdparty/coreutils.git/commit
seq -0.1 0.1 2: print final number when locale's decimal point is ","
authorJim Meyering <meyering@redhat.com>
Thu, 25 Sep 2008 18:01:24 +0000 (20:01 +0200)
committerJim Meyering <meyering@redhat.com>
Fri, 26 Sep 2008 21:31:30 +0000 (23:31 +0200)
commite13188e7ef7bbd609c1586332a335b4194b881aa
treea4d7b7f8bbcd4fee73be6d61bfa7710fe0af9380
parent2a4dcb627ea6310c2be0e8f570b470754bd1fc7e
seq -0.1 0.1 2: print final number when locale's decimal point is ","

* src/seq.c (print_numbers): Use strtold, not c_strtold to convert
from just-formatted-using-asprintf string back to double, since
asprintf may have used something other than "." as the decimal point.
Reported by lsof@nodata.co.uk as <http://bugzilla.redhat.com/463556>.
Thanks to Ondřej Vašík for discovering that the bug was locale-related.

    $ LC_ALL=cs_CZ.UTF-8 seq -0.1 0.1 2|grep 2.0
    [Exit 1]
    $ seq -0.1 0.1 2|grep 2.0
    2.0

* tests/check.mk (TESTS_ENVIRONMENT): Add LOCALE_FR_UTF8, for...
* tests/misc/seq [locale-dec-pt]: New test for the above.
* NEWS (bug fix): Mention it.
NEWS
src/seq.c
tests/check.mk
tests/misc/seq