← Commit list

9517d8ad7

Denys Vlasenko
Denys Vlasenko
2009-06-15
FAILED Duration: 42s

Subject

seq: fix input handling in non-C locales

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

coreutils/seq.c+12 -1
@@ -22,8 +22,15 @@ int seq_main(int argc, char **argv)
unsigned width;
unsigned frac_part;
const char *sep, *opt_s = "\n";
- unsigned opt = getopt32(argv, "+ws:", &opt_s);
+ unsigned opt;
+#if ENABLE_LOCALE_SUPPORT
+ /* Undo busybox.c: on input, we want to use dot
+ * as fractional separator, regardless of current locale */
+ setlocale(LC_NUMERIC, "C");
+#endif
+
+ opt = getopt32(argv, "+ws:", &opt_s);
argc -= optind;
argv += optind;
first = increment = 1;
@@ -44,6 +51,10 @@ int seq_main(int argc, char **argv)
bb_show_usage();
}
+#if ENABLE_LOCALE_SUPPORT
+ setlocale(LC_NUMERIC, "");
+#endif
+
/* Last checked to be compatible with: coreutils-6.10 */
width = 0;
frac_part = 0;