aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2016-10-25 18:19:39 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2016-10-25 18:19:39 +0200
commitcf98b0c0857f4e83caa1c8aca95ad73d9b723e2f (patch)
treeae0a0dac5d32527890785b4860dc58ed96bc3193 /shell
parent960ca385b721400082323da7f8cddb7f3cfb3027 (diff)
downloadbusybox-cf98b0c0857f4e83caa1c8aca95ad73d9b723e2f.tar.gz
ash: [EVAL] Check exit for eval NSUBSHELL
Upstream commit: Date: Tue, 6 Jul 2010 17:50:37 +0800 [PATCH 161/277] [EVAL] Check exit for eval NSUBSHELL Example: $ dash -c 'set -e; (false); echo here' here With this commit, dash exits 1 before echo. The bug was reported by Stefan Fritsch through http://bugs.debian.org/514863 Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> This was fixed differently in our tree: Date: Fri Sep 16 19:04:02 2016 +0000 ash: exit after subshell error when errexit option is set When "set -e" option is on, shell must exit when any command fails, including compound commands of the form (compound-list) executed in a subshell. Bash and dash shells have this behaviour. Also add a corresponding testcase. Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 79439bf3e..9dcf80975 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -8610,11 +8610,9 @@ evaltree(union node *n, int flags)
evalfn = evalloop;
goto calleval;
case NSUBSHELL:
- evalfn = evalsubshell;
- goto checkexit;
case NBACKGND:
evalfn = evalsubshell;
- goto calleval;
+ goto checkexit;
case NPIPE:
evalfn = evalpipe;
goto checkexit;