diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2014-08-13 10:09:49 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2014-08-13 10:09:49 +0200 |
commit | 841f8331d79c642b4268dae52c382fab2da9cddc (patch) | |
tree | e2d69ca863fc404669d78952b48561fde336431f | |
parent | c538d5bcc304d1ac99783de2337937c70a7013c7 (diff) | |
download | busybox-w32-841f8331d79c642b4268dae52c382fab2da9cddc.tar.gz busybox-w32-841f8331d79c642b4268dae52c382fab2da9cddc.tar.bz2 busybox-w32-841f8331d79c642b4268dae52c382fab2da9cddc.zip |
ash,hush: run reinit_unicode() only if makes sense
With static Unicode support, no need to check $LANG et al.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | shell/ash.c | 4 | ||||
-rw-r--r-- | shell/hush.c | 12 |
2 files changed, 11 insertions, 5 deletions
diff --git a/shell/ash.c b/shell/ash.c index dc7a9bf4f..3b8aac553 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -9661,7 +9661,9 @@ preadfd(void) | |||
9661 | * _during_ shell execution, not only if it was set when | 9661 | * _during_ shell execution, not only if it was set when |
9662 | * shell was started. Therefore, re-check LANG every time: | 9662 | * shell was started. Therefore, re-check LANG every time: |
9663 | */ | 9663 | */ |
9664 | { | 9664 | if (ENABLE_FEATURE_CHECK_UNICODE_IN_ENV |
9665 | || ENABLE_UNICODE_USING_LOCALE | ||
9666 | ) { | ||
9665 | const char *s = lookupvar("LC_ALL"); | 9667 | const char *s = lookupvar("LC_ALL"); |
9666 | if (!s) s = lookupvar("LC_CTYPE"); | 9668 | if (!s) s = lookupvar("LC_CTYPE"); |
9667 | if (!s) s = lookupvar("LANG"); | 9669 | if (!s) s = lookupvar("LANG"); |
diff --git a/shell/hush.c b/shell/hush.c index 7d3547110..92d790180 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -1985,10 +1985,14 @@ static void reinit_unicode_for_hush(void) | |||
1985 | * _during_ shell execution, not only if it was set when | 1985 | * _during_ shell execution, not only if it was set when |
1986 | * shell was started. Therefore, re-check LANG every time: | 1986 | * shell was started. Therefore, re-check LANG every time: |
1987 | */ | 1987 | */ |
1988 | const char *s = get_local_var_value("LC_ALL"); | 1988 | if (ENABLE_FEATURE_CHECK_UNICODE_IN_ENV |
1989 | if (!s) s = get_local_var_value("LC_CTYPE"); | 1989 | || ENABLE_UNICODE_USING_LOCALE |
1990 | if (!s) s = get_local_var_value("LANG"); | 1990 | ) { |
1991 | reinit_unicode(s); | 1991 | const char *s = get_local_var_value("LC_ALL"); |
1992 | if (!s) s = get_local_var_value("LC_CTYPE"); | ||
1993 | if (!s) s = get_local_var_value("LANG"); | ||
1994 | reinit_unicode(s); | ||
1995 | } | ||
1992 | } | 1996 | } |
1993 | 1997 | ||
1994 | 1998 | ||