diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-01-26 16:37:01 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-01-26 22:41:09 -0800 |
commit | 3fe8bc09be53d9160073abf09d8ec0fa39740fa6 (patch) | |
tree | b148bc2963d034d5ebc8ebe93e613ffe72bc992f /src/seq.c | |
parent | 3cd48057c70f7e733e6b39e0ab3bb43c4e2d1c13 (diff) | |
download | coreutils-3fe8bc09be53d9160073abf09d8ec0fa39740fa6.tar.gz |
printf,seq,sleep,tail,timeout: accept current-locale floats
These commands now accept floating-point numbers in the
current locale, as well as in the C locale.
Compatibility problem reported by Robert Elz.
* NEWS: Document this.
* bootstrap.conf (gnulib_modules): Add cl-strtod, cl-strtold.
Remove c-strtold.
* doc/coreutils.texi (Floating point, tail invocation)
(printf invocation, timeout invocation, sleep invocation)
(seq invocation): Document this.
* gl/lib/cl-strtod.c, gl/lib/cl-strtod.h, gl/lib/cl-strtold.c:
* gl/modules/cl-strtod, gl/modules/cl-strtold: New files.
* src/printf.c, src/seq.c, src/sleep.c, src/tail.c, src/timeout.c:
Include cl-strtod.h instead of c-strtod.
* src/printf.c (vstrtold):
* src/seq.c (scan_arg, print_numbers):
* src/sleep.c (main):
* src/tail.c (parse_options):
* src/timeout.c (parse_duration):
Use cl_strtold instead of c_strtold.
Diffstat (limited to 'src/seq.c')
-rw-r--r-- | src/seq.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -23,7 +23,7 @@ #include "system.h" #include "die.h" -#include "c-strtod.h" +#include "cl-strtod.h" #include "error.h" #include "quote.h" #include "xstrtod.h" @@ -142,7 +142,7 @@ scan_arg (const char *arg) { operand ret; - if (! xstrtold (arg, NULL, &ret.value, c_strtold)) + if (! xstrtold (arg, NULL, &ret.value, cl_strtold)) { error (0, 0, _("invalid floating point argument: %s"), quote (arg)); usage (EXIT_FAILURE); @@ -331,7 +331,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, cl_strtold) && x_val == last) { char *x0_str = NULL; |