about summary refs log tree commit diff
path: root/Src/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/init.c')
-rw-r--r--Src/init.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Src/init.c b/Src/init.c
index f0b9803e4..00ecd3ade 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -113,8 +113,8 @@ loop(int toplevel, int justonce)
 	if (!(list = parse_event())) {	/* if we couldn't parse a list */
 	    hend();
 	    if ((tok == ENDINPUT && !errflag) ||
-		(tok == LEXERR && (!isset(SHINSTDIN) || !toplevel)) ||
-		justonce)
+		(tok == LEXERR && (!noerrexit || emulation == EMULATE_KSH)
+		 && (!isset(SHINSTDIN) || !toplevel)) || justonce)
 		break;
 	    continue;
 	}