summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko2007-01-01 23:53:12 +0000
committerDenis Vlasenko2007-01-01 23:53:12 +0000
commit6dc6ebbf44f01f31b683ddde36f0ba694b98bbdd (patch)
treed37cdd5a65b6cd7b5ec9b83e15c5d97365768f17
parentf782f52c8cab1457d9e912b8bf2afdde6d170816 (diff)
downloadbusybox-6dc6ebbf44f01f31b683ddde36f0ba694b98bbdd.zip
busybox-6dc6ebbf44f01f31b683ddde36f0ba694b98bbdd.tar.gz
awk: undo locale setting for numbers - or else parsing
can act quite mysteriously date: add if(ENABLE_LOCALE_SUPPORT)
-rw-r--r--coreutils/date.c3
-rw-r--r--editors/awk.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/coreutils/date.c b/coreutils/date.c
index 37ccfd5..a6690e8 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -212,7 +212,8 @@ format_utc:
}
} else if (opt & DATE_OPT_RFC2822) {
/* Undo busybox.c for date -R */
- setlocale(LC_TIME, "C");
+ if (ENABLE_LOCALE_SUPPORT)
+ setlocale(LC_TIME, "C");
strcpy(date_fmt, "%a, %d %b %Y %H:%M:%S ");
i = 22;
goto format_utc;
diff --git a/editors/awk.c b/editors/awk.c
index 97e7816..f48b0e4 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -2652,6 +2652,11 @@ int awk_main(int argc, char **argv)
char *vnames = (char *)vNames; /* cheat */
char *vvalues = (char *)vValues;
+ /* Undo busybox.c, or else strtod may eat ','! This breaks parsing:
+ * $1,$2 == '$1,' '$2', NOT '$1' ',' '$2' */
+ if (ENABLE_LOCALE_SUPPORT)
+ setlocale(LC_NUMERIC, "C");
+
zero_out_var(&tv);
/* allocate global buffer */