summary refs log tree commit diff
path: root/Src/builtin.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2016-11-08 13:02:24 +0000
committerPeter Stephenson <pws@zsh.org>2016-11-08 13:02:57 +0000
commita57977d01acc3b1b63aec1b79394ef7ffd052912 (patch)
tree31453161137d799ce25232a58bd0c116a9c2a621 /Src/builtin.c
parentdfb2f3f3d24f40012d129d3c205c9ca149f1bc1e (diff)
downloadzsh-a57977d01acc3b1b63aec1b79394ef7ffd052912.tar.gz
zsh-a57977d01acc3b1b63aec1b79394ef7ffd052912.tar.xz
zsh-a57977d01acc3b1b63aec1b79394ef7ffd052912.zip
39870: ensure exit trap can always run
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);