summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-09-25 20:01:24 +0200
committerJim Meyering <meyering@redhat.com>2008-09-26 23:31:30 +0200
commite13188e7ef7bbd609c1586332a335b4194b881aa (patch)
treea4d7b7f8bbcd4fee73be6d61bfa7710fe0af9380 /src
parent2a4dcb627ea6310c2be0e8f570b470754bd1fc7e (diff)
downloadcoreutils-e13188e7ef7bbd609c1586332a335b4194b881aa.tar.xz
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.
Diffstat (limited to 'src')
-rw-r--r--src/seq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/seq.c b/src/seq.c
index 55518dfab..b5f0651d1 100644
--- a/src/seq.c
+++ b/src/seq.c
@@ -306,7 +306,7 @@ print_numbers (char const *fmt, struct layout layout,
xalloc_die ();
x_str[x_strlen - layout.suffix_len] = '\0';
- if (xstrtold (x_str + layout.prefix_len, NULL, &x_val, c_strtold)
+ if (xstrtold (x_str + layout.prefix_len, NULL, &x_val, strtold)
&& abs_rel_diff (x_val, last) < DBL_EPSILON)
{
char *x0_str = NULL;