diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-06-15 15:47:58 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-06-15 15:47:58 +0200 |
commit | 9517d8ad72c8db8336ea8dba05a64df44688dec8 (patch) | |
tree | 56395f6a42da68a2d719bfd9ce20db8282f7a0c0 | |
parent | 6548edd430271f6b6d2b295c77a4fdaec51a2468 (diff) | |
download | busybox-w32-9517d8ad72c8db8336ea8dba05a64df44688dec8.tar.gz busybox-w32-9517d8ad72c8db8336ea8dba05a64df44688dec8.tar.bz2 busybox-w32-9517d8ad72c8db8336ea8dba05a64df44688dec8.zip |
seq: fix input handling in non-C locales
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | coreutils/seq.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/coreutils/seq.c b/coreutils/seq.c index bb39a5b54..03ae3c632 100644 --- a/coreutils/seq.c +++ b/coreutils/seq.c | |||
@@ -22,8 +22,15 @@ int seq_main(int argc, char **argv) | |||
22 | unsigned width; | 22 | unsigned width; |
23 | unsigned frac_part; | 23 | unsigned frac_part; |
24 | const char *sep, *opt_s = "\n"; | 24 | const char *sep, *opt_s = "\n"; |
25 | unsigned opt = getopt32(argv, "+ws:", &opt_s); | 25 | unsigned opt; |
26 | 26 | ||
27 | #if ENABLE_LOCALE_SUPPORT | ||
28 | /* Undo busybox.c: on input, we want to use dot | ||
29 | * as fractional separator, regardless of current locale */ | ||
30 | setlocale(LC_NUMERIC, "C"); | ||
31 | #endif | ||
32 | |||
33 | opt = getopt32(argv, "+ws:", &opt_s); | ||
27 | argc -= optind; | 34 | argc -= optind; |
28 | argv += optind; | 35 | argv += optind; |
29 | first = increment = 1; | 36 | first = increment = 1; |
@@ -44,6 +51,10 @@ int seq_main(int argc, char **argv) | |||
44 | bb_show_usage(); | 51 | bb_show_usage(); |
45 | } | 52 | } |
46 | 53 | ||
54 | #if ENABLE_LOCALE_SUPPORT | ||
55 | setlocale(LC_NUMERIC, ""); | ||
56 | #endif | ||
57 | |||
47 | /* Last checked to be compatible with: coreutils-6.10 */ | 58 | /* Last checked to be compatible with: coreutils-6.10 */ |
48 | width = 0; | 59 | width = 0; |
49 | frac_part = 0; | 60 | frac_part = 0; |