summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2014-10-03 14:07:07 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2014-10-03 14:07:07 +0800
commit0d1fb088a4a16569260de4266d4bd359491c6bcd (patch)
tree4dd2e92dc1bffc7eb1acc4ae85f8c3db89bf86f5 /src
parent[ERROR] Set exitstatus in onint (diff)
downloaddash-0d1fb088a4a16569260de4266d4bd359491c6bcd.tar.gz
dash-0d1fb088a4a16569260de4266d4bd359491c6bcd.zip
[EVAL] Do not clobber exitstatus in evalcommand
All originators of EXERROR have been setting the exitstatus for
a while now.  So it is no longer appropriate to set it explicitly
in evalcommand.

In fact doing so may cause the original exitstatus to be lost.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'src')
-rw-r--r--src/eval.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/eval.c b/src/eval.c
index 0708bf5..3f4d957 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -853,12 +853,9 @@ bail:
 				listsetvar(varlist.list, VEXPORT);
 		}
 		if (evalbltin(cmdentry.u.cmd, argc, argv, flags)) {
-			if (exception == EXERROR) {
-				exitstatus = 2;
-				if (spclbltin <= 0) {
-					FORCEINTON;
-					break;
-				}
+			if (exception == EXERROR && spclbltin <= 0) {
+				FORCEINTON;
+				break;
 			}
 raise:
 			longjmp(handler->loc, 1);