summary refs log tree commit diff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 0d69e4f..4902cfa 100644
--- a/src/main.c
+++ b/src/main.c
@@ -138,13 +138,17 @@ main(int argc, char **argv)
 			status = 2;
 			break;
 
+		case EXEXIT:
+		case EXEVAL:
+			state = 0;
+			/* fall through */
 		default:
 			status = exitstatus;
 			break;
 		}
 		exitstatus = status;
 
-		if (e == EXEXIT || state == 0 || iflag == 0 || ! rootshell)
+		if (state == 0 || iflag == 0 || shlvl)
 			exitshell();
 
 		if (e == EXINT