aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-12-31 17:30:02 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2017-12-31 17:30:02 +0100
commit82d1c1f84ae23793d81b50aa0a753ad7c4db4f51 (patch)
treee5c1dc00b04299cf627cf2ef18453aea96c5f1e5 /shell
parent36acc4631c94bb0f43ecaac5d61dc773ef773e91 (diff)
downloadbusybox-w32-82d1c1f84ae23793d81b50aa0a753ad7c4db4f51.tar.gz
busybox-w32-82d1c1f84ae23793d81b50aa0a753ad7c4db4f51.tar.bz2
busybox-w32-82d1c1f84ae23793d81b50aa0a753ad7c4db4f51.zip
randomconfig fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c2
-rw-r--r--shell/hush.c13
2 files changed, 9 insertions, 6 deletions
diff --git a/shell/ash.c b/shell/ash.c
index e69ddb4ff..dfb7d4d8e 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -9952,7 +9952,7 @@ evalcommand(union node *cmd, int flags)
9952 switch (cmdentry.cmdtype) { 9952 switch (cmdentry.cmdtype) {
9953 default: { 9953 default: {
9954 9954
9955#if ENABLE_FEATURE_SH_NOFORK 9955#if ENABLE_FEATURE_SH_NOFORK && NUM_APPLETS > 1
9956/* (1) BUG: if variables are set, we need to fork, or save/restore them 9956/* (1) BUG: if variables are set, we need to fork, or save/restore them
9957 * around run_nofork_applet() call. 9957 * around run_nofork_applet() call.
9958 * (2) Should this check also be done in forkshell()? 9958 * (2) Should this check also be done in forkshell()?
diff --git a/shell/hush.c b/shell/hush.c
index 708555ac4..df1b046ab 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -2278,7 +2278,7 @@ static int unset_local_var_len(const char *name, int name_len)
2278 return EXIT_SUCCESS; 2278 return EXIT_SUCCESS;
2279} 2279}
2280 2280
2281#if ENABLE_HUSH_UNSET 2281#if ENABLE_HUSH_UNSET || ENABLE_HUSH_GETOPTS
2282static int unset_local_var(const char *name) 2282static int unset_local_var(const char *name)
2283{ 2283{
2284 return unset_local_var_len(name, strlen(name)); 2284 return unset_local_var_len(name, strlen(name));
@@ -2300,7 +2300,7 @@ static void unset_vars(char **strings)
2300 free(strings); 2300 free(strings);
2301} 2301}
2302 2302
2303#if BASH_HOSTNAME_VAR || ENABLE_FEATURE_SH_MATH || ENABLE_HUSH_READ 2303#if BASH_HOSTNAME_VAR || ENABLE_FEATURE_SH_MATH || ENABLE_HUSH_READ || ENABLE_HUSH_GETOPTS
2304static void FAST_FUNC set_local_var_from_halves(const char *name, const char *val) 2304static void FAST_FUNC set_local_var_from_halves(const char *name, const char *val)
2305{ 2305{
2306 char *var = xasprintf("%s=%s", name, val); 2306 char *var = xasprintf("%s=%s", name, val);
@@ -5534,7 +5534,7 @@ static int expand_on_ifs(int *ended_with_ifs, o_string *output, int n, const cha
5534static char *encode_then_expand_string(const char *str, int process_bkslash, int do_unbackslash) 5534static char *encode_then_expand_string(const char *str, int process_bkslash, int do_unbackslash)
5535{ 5535{
5536#if !BASH_PATTERN_SUBST 5536#if !BASH_PATTERN_SUBST
5537 const int do_unbackslash = 1; 5537 enum { do_unbackslash = 1 };
5538#endif 5538#endif
5539 char *exp_str; 5539 char *exp_str;
5540 struct in_str input; 5540 struct in_str input;
@@ -8139,7 +8139,7 @@ static NOINLINE int run_pipe(struct pipe *pi)
8139 return rcode; 8139 return rcode;
8140 } 8140 }
8141 8141
8142 if (ENABLE_FEATURE_SH_NOFORK) { 8142 if (ENABLE_FEATURE_SH_NOFORK && NUM_APPLETS > 1) {
8143 int n = find_applet_by_name(argv_expanded[0]); 8143 int n = find_applet_by_name(argv_expanded[0]);
8144 if (n >= 0 && APPLET_IS_NOFORK(n)) { 8144 if (n >= 0 && APPLET_IS_NOFORK(n)) {
8145 rcode = redirect_and_varexp_helper(&new_env, &old_vars, command, &squirrel, argv_expanded); 8145 rcode = redirect_and_varexp_helper(&new_env, &old_vars, command, &squirrel, argv_expanded);
@@ -8387,7 +8387,10 @@ static int run_list(struct pipe *pi)
8387 rword, cond_code, last_rword); 8387 rword, cond_code, last_rword);
8388 8388
8389 sv_errexit_depth = G.errexit_depth; 8389 sv_errexit_depth = G.errexit_depth;
8390 if (IF_HAS_KEYWORDS(rword == RES_IF || rword == RES_ELIF ||) 8390 if (
8391#if ENABLE_HUSH_IF
8392 rword == RES_IF || rword == RES_ELIF ||
8393#endif
8391 pi->followup != PIPE_SEQ 8394 pi->followup != PIPE_SEQ
8392 ) { 8395 ) {
8393 G.errexit_depth++; 8396 G.errexit_depth++;