summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2010-10-07 10:55:15 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2010-10-07 10:55:15 +0800
commit7f684260a2426ac61c06d2e4822429b00437ae24 (patch)
treed83efa4a89c7bbc607768a49074c3efc9fd91a52 /src
parent[BUILTIN] Fix trailing field bug in read(1) (diff)
downloaddash-7f684260a2426ac61c06d2e4822429b00437ae24.tar.gz
dash-7f684260a2426ac61c06d2e4822429b00437ae24.zip
[BUILTIN] Fix EXEXEC status clobbering
evalcommand always clobbers the exit status in case of an EXEXEC
which means that exec always fails with exit status 2 regardless
of what it actually returns.

This patch adds the missing check for EXEXEC so that the correct
exit status is preserved.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r--src/eval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c
index 5b8d36b..b966749 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -854,7 +854,7 @@ bail:
 			int i;
 
 			i = exception;
-			if (i == EXEXIT)
+			if (i == EXEXIT || i == EXEXEC)
 				goto raise;
 
 			status = (i == EXINT) ? SIGINT + 128 : 2;