aboutsummaryrefslogtreecommitdiff
path: root/shell/hush.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/hush.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/hush.c')
-rw-r--r--shell/hush.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 64d5e8587..339f3349a 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -81,7 +81,6 @@
81 * $ "export" i=`echo 'aaa bbb'`; echo "$i" 81 * $ "export" i=`echo 'aaa bbb'`; echo "$i"
82 * aaa 82 * aaa
83 */ 83 */
84#include "busybox.h" /* for APPLET_IS_NOFORK/NOEXEC */
85#if !(defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \ 84#if !(defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \
86 || defined(__APPLE__) \ 85 || defined(__APPLE__) \
87 ) 86 )
@@ -93,6 +92,8 @@
93# include <fnmatch.h> 92# include <fnmatch.h>
94#endif 93#endif
95 94
95#include "busybox.h" /* for APPLET_IS_NOFORK/NOEXEC */
96#include "unicode.h"
96#include "shell_common.h" 97#include "shell_common.h"
97#include "math.h" 98#include "math.h"
98#include "match.h" 99#include "match.h"
@@ -105,14 +106,6 @@
105# define PIPE_BUF 4096 /* amount of buffering in a pipe */ 106# define PIPE_BUF 4096 /* amount of buffering in a pipe */
106#endif 107#endif
107 108
108//applet:IF_HUSH(APPLET(hush, BB_DIR_BIN, BB_SUID_DROP))
109//applet:IF_MSH(APPLET(msh, BB_DIR_BIN, BB_SUID_DROP))
110//applet:IF_FEATURE_SH_IS_HUSH(APPLET_ODDNAME(sh, hush, BB_DIR_BIN, BB_SUID_DROP, sh))
111//applet:IF_FEATURE_BASH_IS_HUSH(APPLET_ODDNAME(bash, hush, BB_DIR_BIN, BB_SUID_DROP, bash))
112
113//kbuild:lib-$(CONFIG_HUSH) += hush.o match.o shell_common.o
114//kbuild:lib-$(CONFIG_HUSH_RANDOM_SUPPORT) += random.o
115
116//config:config HUSH 109//config:config HUSH
117//config: bool "hush" 110//config: bool "hush"
118//config: default y 111//config: default y
@@ -249,6 +242,14 @@
249//config: msh is deprecated and will be removed, please migrate to hush. 242//config: msh is deprecated and will be removed, please migrate to hush.
250//config: 243//config:
251 244
245//applet:IF_HUSH(APPLET(hush, BB_DIR_BIN, BB_SUID_DROP))
246//applet:IF_MSH(APPLET(msh, BB_DIR_BIN, BB_SUID_DROP))
247//applet:IF_FEATURE_SH_IS_HUSH(APPLET_ODDNAME(sh, hush, BB_DIR_BIN, BB_SUID_DROP, sh))
248//applet:IF_FEATURE_BASH_IS_HUSH(APPLET_ODDNAME(bash, hush, BB_DIR_BIN, BB_SUID_DROP, bash))
249
250//kbuild:lib-$(CONFIG_HUSH) += hush.o match.o shell_common.o
251//kbuild:lib-$(CONFIG_HUSH_RANDOM_SUPPORT) += random.o
252
252/* -i (interactive) and -s (read stdin) are also accepted, 253/* -i (interactive) and -s (read stdin) are also accepted,
253 * but currently do nothing, therefore aren't shown in help. 254 * but currently do nothing, therefore aren't shown in help.
254 * NOMMU-specific options are not meant to be used by users, 255 * NOMMU-specific options are not meant to be used by users,
@@ -1906,6 +1907,12 @@ static void get_user_input(struct in_str *i)
1906 /* Enable command line editing only while a command line 1907 /* Enable command line editing only while a command line
1907 * is actually being read */ 1908 * is actually being read */
1908 do { 1909 do {
1910 /* Unicode support should be activated even if LANG is set
1911 * _during_ shell execution, not only if it was set when
1912 * shell was started. Therefore, re-check LANG every time:
1913 */
1914 reinit_unicode(get_local_var_value("LANG"));
1915
1909 G.flag_SIGINT = 0; 1916 G.flag_SIGINT = 0;
1910 /* buglet: SIGINT will not make new prompt to appear _at once_, 1917 /* buglet: SIGINT will not make new prompt to appear _at once_,
1911 * only after <Enter>. (^C will work) */ 1918 * only after <Enter>. (^C will work) */