summaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/hush.c')
-rw-r--r--shell/hush.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 7d35471..92d7901 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);
+ }
}