aboutsummaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-03-23 17:59:27 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2011-03-23 17:59:27 +0100
commit20704f066250744c0c2b84920c27d0fd0aa9e935 (patch)
tree8a76e56e4be0beb84dbe993922d4be86ab694350 /shell/ash.c
parent7f4b769c42f3773ff2e2e749547291dcb7e85d01 (diff)
downloadbusybox-w32-20704f066250744c0c2b84920c27d0fd0aa9e935.tar.gz
busybox-w32-20704f066250744c0c2b84920c27d0fd0aa9e935.tar.bz2
busybox-w32-20704f066250744c0c2b84920c27d0fd0aa9e935.zip
ash,hush: recheck LANG before every line input
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 0baf7c8e5..1520c5ae5 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -36,12 +36,14 @@
36 36
37#define JOBS ENABLE_ASH_JOB_CONTROL 37#define JOBS ENABLE_ASH_JOB_CONTROL
38 38
39#include "busybox.h" /* for applet_names */
40#include <paths.h> 39#include <paths.h>
41#include <setjmp.h> 40#include <setjmp.h>
42#include <fnmatch.h> 41#include <fnmatch.h>
43#include <sys/times.h> 42#include <sys/times.h>
44 43
44#include "busybox.h" /* for applet_names */
45#include "unicode.h"
46
45#include "shell_common.h" 47#include "shell_common.h"
46#if ENABLE_SH_MATH_SUPPORT 48#if ENABLE_SH_MATH_SUPPORT
47# include "math.h" 49# include "math.h"
@@ -72,13 +74,6 @@
72# error "Do not even bother, ash will not run on NOMMU machine" 74# error "Do not even bother, ash will not run on NOMMU machine"
73#endif 75#endif
74 76
75//applet:IF_ASH(APPLET(ash, BB_DIR_BIN, BB_SUID_DROP))
76//applet:IF_FEATURE_SH_IS_ASH(APPLET_ODDNAME(sh, ash, BB_DIR_BIN, BB_SUID_DROP, sh))
77//applet:IF_FEATURE_BASH_IS_ASH(APPLET_ODDNAME(bash, ash, BB_DIR_BIN, BB_SUID_DROP, bash))
78
79//kbuild:lib-$(CONFIG_ASH) += ash.o ash_ptr_hack.o shell_common.o
80//kbuild:lib-$(CONFIG_ASH_RANDOM_SUPPORT) += random.o
81
82//config:config ASH 77//config:config ASH
83//config: bool "ash" 78//config: bool "ash"
84//config: default y 79//config: default y
@@ -190,6 +185,13 @@
190//config: variable each time it is displayed. 185//config: variable each time it is displayed.
191//config: 186//config:
192 187
188//applet:IF_ASH(APPLET(ash, BB_DIR_BIN, BB_SUID_DROP))
189//applet:IF_FEATURE_SH_IS_ASH(APPLET_ODDNAME(sh, ash, BB_DIR_BIN, BB_SUID_DROP, sh))
190//applet:IF_FEATURE_BASH_IS_ASH(APPLET_ODDNAME(bash, ash, BB_DIR_BIN, BB_SUID_DROP, bash))
191
192//kbuild:lib-$(CONFIG_ASH) += ash.o ash_ptr_hack.o shell_common.o
193//kbuild:lib-$(CONFIG_ASH_RANDOM_SUPPORT) += random.o
194
193 195
194/* ============ Hash table sizes. Configurable. */ 196/* ============ Hash table sizes. Configurable. */
195 197
@@ -9626,6 +9628,11 @@ preadfd(void)
9626# if ENABLE_FEATURE_TAB_COMPLETION 9628# if ENABLE_FEATURE_TAB_COMPLETION
9627 line_input_state->path_lookup = pathval(); 9629 line_input_state->path_lookup = pathval();
9628# endif 9630# endif
9631 /* Unicode support should be activated even if LANG is set
9632 * _during_ shell execution, not only if it was set when
9633 * shell was started. Therefore, re-check LANG every time:
9634 */
9635 reinit_unicode(lookupvar("LANG"));
9629 nr = read_line_input(line_input_state, cmdedit_prompt, buf, IBUFSIZ, timeout); 9636 nr = read_line_input(line_input_state, cmdedit_prompt, buf, IBUFSIZ, timeout);
9630 if (nr == 0) { 9637 if (nr == 0) {
9631 /* Ctrl+C pressed */ 9638 /* Ctrl+C pressed */