about summary refs log tree commit diff
path: root/Src/signals.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-04-27 10:03:14 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-04-27 10:03:14 +0000
commit24aed1f2b1790f4ed6defac392230a6aa1f37dfd (patch)
treeb708f5292afc5cf561d88b0bdc4972ac9d345d9c /Src/signals.c
parent0b136fcaf4fccab44a43ba171623d3b2ed402ac3 (diff)
downloadzsh-24aed1f2b1790f4ed6defac392230a6aa1f37dfd.tar.gz
zsh-24aed1f2b1790f4ed6defac392230a6aa1f37dfd.tar.xz
zsh-24aed1f2b1790f4ed6defac392230a6aa1f37dfd.zip
21197: Fix LOCAL_TRAPS inside another trap
Diffstat (limited to 'Src/signals.c')
-rw-r--r--Src/signals.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/Src/signals.c b/Src/signals.c
index e5225b6c5..8b70c880a 100644
--- a/Src/signals.c
+++ b/Src/signals.c
@@ -862,6 +862,10 @@ removetrap(int sig)
 void
 starttrapscope(void)
 {
+    /* No special SIGEXIT behaviour inside another trap. */
+    if (intrap)
+	return;
+
     /*
      * SIGEXIT needs to be restored at the current locallevel,
      * so give it the next higher one. dosavetrap() is called
@@ -891,8 +895,11 @@ endtrapscope(void)
     /*
      * Remember the exit trap, but don't run it until
      * after all the other traps have been put back.
+     * Don't do this inside another trap.
      */
-    if ((exittr = sigtrapped[SIGEXIT])) {
+    if (intrap)
+	exittr = 0;
+    else if ((exittr = sigtrapped[SIGEXIT])) {
 	if (exittr & ZSIG_FUNC) {
 	    exitfn = removehashnode(shfunctab, "TRAPEXIT");
 	} else {