From 841f8331d79c642b4268dae52c382fab2da9cddc Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 13 Aug 2014 10:09:49 +0200 Subject: 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 --- shell/hush.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'shell/hush.c') 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) * _during_ shell execution, not only if it was set when * shell was started. Therefore, re-check LANG every time: */ - const char *s = get_local_var_value("LC_ALL"); - if (!s) s = get_local_var_value("LC_CTYPE"); - if (!s) s = get_local_var_value("LANG"); - reinit_unicode(s); + if (ENABLE_FEATURE_CHECK_UNICODE_IN_ENV + || ENABLE_UNICODE_USING_LOCALE + ) { + const char *s = get_local_var_value("LC_ALL"); + if (!s) s = get_local_var_value("LC_CTYPE"); + if (!s) s = get_local_var_value("LANG"); + reinit_unicode(s); + } } -- cgit v1.2.3