ash,hush: recheck LANG before every line input
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
23
shell/ash.c
23
shell/ash.c
@@ -36,12 +36,14 @@
|
||||
|
||||
#define JOBS ENABLE_ASH_JOB_CONTROL
|
||||
|
||||
#include "busybox.h" /* for applet_names */
|
||||
#include <paths.h>
|
||||
#include <setjmp.h>
|
||||
#include <fnmatch.h>
|
||||
#include <sys/times.h>
|
||||
|
||||
#include "busybox.h" /* for applet_names */
|
||||
#include "unicode.h"
|
||||
|
||||
#include "shell_common.h"
|
||||
#if ENABLE_SH_MATH_SUPPORT
|
||||
# include "math.h"
|
||||
@@ -72,13 +74,6 @@
|
||||
# error "Do not even bother, ash will not run on NOMMU machine"
|
||||
#endif
|
||||
|
||||
//applet:IF_ASH(APPLET(ash, BB_DIR_BIN, BB_SUID_DROP))
|
||||
//applet:IF_FEATURE_SH_IS_ASH(APPLET_ODDNAME(sh, ash, BB_DIR_BIN, BB_SUID_DROP, sh))
|
||||
//applet:IF_FEATURE_BASH_IS_ASH(APPLET_ODDNAME(bash, ash, BB_DIR_BIN, BB_SUID_DROP, bash))
|
||||
|
||||
//kbuild:lib-$(CONFIG_ASH) += ash.o ash_ptr_hack.o shell_common.o
|
||||
//kbuild:lib-$(CONFIG_ASH_RANDOM_SUPPORT) += random.o
|
||||
|
||||
//config:config ASH
|
||||
//config: bool "ash"
|
||||
//config: default y
|
||||
@@ -190,6 +185,13 @@
|
||||
//config: variable each time it is displayed.
|
||||
//config:
|
||||
|
||||
//applet:IF_ASH(APPLET(ash, BB_DIR_BIN, BB_SUID_DROP))
|
||||
//applet:IF_FEATURE_SH_IS_ASH(APPLET_ODDNAME(sh, ash, BB_DIR_BIN, BB_SUID_DROP, sh))
|
||||
//applet:IF_FEATURE_BASH_IS_ASH(APPLET_ODDNAME(bash, ash, BB_DIR_BIN, BB_SUID_DROP, bash))
|
||||
|
||||
//kbuild:lib-$(CONFIG_ASH) += ash.o ash_ptr_hack.o shell_common.o
|
||||
//kbuild:lib-$(CONFIG_ASH_RANDOM_SUPPORT) += random.o
|
||||
|
||||
|
||||
/* ============ Hash table sizes. Configurable. */
|
||||
|
||||
@@ -9626,6 +9628,11 @@ preadfd(void)
|
||||
# if ENABLE_FEATURE_TAB_COMPLETION
|
||||
line_input_state->path_lookup = pathval();
|
||||
# endif
|
||||
/* Unicode support should be activated even if LANG is set
|
||||
* _during_ shell execution, not only if it was set when
|
||||
* shell was started. Therefore, re-check LANG every time:
|
||||
*/
|
||||
reinit_unicode(lookupvar("LANG"));
|
||||
nr = read_line_input(line_input_state, cmdedit_prompt, buf, IBUFSIZ, timeout);
|
||||
if (nr == 0) {
|
||||
/* Ctrl+C pressed */
|
||||
|
Reference in New Issue
Block a user