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.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Src/init.c b/Src/init.c
index 76797ab2a..0fde9f7ac 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -131,6 +131,15 @@ loop(int toplevel, int justonce)
 		(tok == LEXERR && (!isset(SHINSTDIN) || !toplevel)) ||
 		justonce)
 		break;
+	    if (exit_pending) {
+		/*
+		 * Something down there (a ZLE function?) decided
+		 * to exit when there was stuff to clear up.
+		 * Handle that now.
+		 */
+		stopmsg = 1;
+		zexit(exit_pending >> 1, 0);
+	    }
 	    if (tok == LEXERR && !lastval)
 		lastval = 1;
 	    continue;