summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/eval.c3
-rw-r--r--src/main.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/eval.c b/src/eval.c
index 071fb1b..30c05f9 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -172,7 +172,8 @@ evalstring(char *s, int flags)
 	status = 0;
 	while ((n = parsecmd(0)) != NEOF) {
 		evaltree(n, flags & ~(parser_eof() ? 0 : EV_EXIT));
-		status = exitstatus;
+		if (n)
+			status = exitstatus;
 		popstackmark(&smark);
 		if (evalskip)
 			break;
diff --git a/src/main.c b/src/main.c
index bedb663..497ac16 100644
--- a/src/main.c
+++ b/src/main.c
@@ -228,7 +228,8 @@ cmdloop(int top)
 			job_warning = (job_warning == 2) ? 1 : 0;
 			numeof = 0;
 			evaltree(n, 0);
-			status = exitstatus;
+			if (n)
+				status = exitstatus;
 		}
 		popstackmark(&smark);