about summary refs log tree commit diff
path: root/Src/builtin.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/builtin.c')
-rw-r--r--Src/builtin.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index 6c9d05872..696971944 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -5435,6 +5435,11 @@ zexit(int val, int from_where)
 	}
     }
     lastval = val;
+    /*
+     * Now we are committed to exiting any previous state
+     * is irrelevant.  Ensure trap can run.
+     */
+    errflag = intrap = 0;
     if (sigtrapped[SIGEXIT])
 	dotrap(SIGEXIT);
     callhookfunc("zshexit", NULL, 1, NULL);