summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ChangeLog4
-rw-r--r--src/eval.c9
2 files changed, 7 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 9a601df..4dc8fa3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-10-03  Herbert Xu <herbert@gondor.apana.org.au>
+
+	* Do not clobber exitstatus in evalcommand.
+
 2014-10-02  Herbert Xu <herbert@gondor.apana.org.au>
 
 	* Fix use-after-free in dotrap/evalstring.
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);