summary refs log tree commit diff
path: root/Src/signals.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/signals.c')
-rw-r--r--Src/signals.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/Src/signals.c b/Src/signals.c
index 064feb480..6c6c28159 100644
--- a/Src/signals.c
+++ b/Src/signals.c
@@ -943,6 +943,11 @@ endtrapscope(void)
 /**/
 int intrap;
 
+/* Is the current trap a function? */
+
+/**/
+int trapisfunc;
+
 /**/
 void
 dotrapargs(int sig, int *sigtr, void *sigfn)
@@ -1001,19 +1006,19 @@ dotrapargs(int sig, int *sigtr, void *sigfn)
 	zaddlinknode(args, num);
 
 	trapreturn = -1;	/* incremented by doshfunc */
+	trapisfunc = isfunc = 1;
+
 	sfcontext = SFC_SIGNAL;
 	doshfunc(name, sigfn, args, 0, 1);
 	sfcontext = osc;
 	freelinklist(args, (FreeFunc) NULL);
 	zsfree(name);
 
-	isfunc = 1;
     } else {
 	trapreturn = -2;	/* not incremented, used at current level */
+	trapisfunc = isfunc = 0;
 
 	execode(sigfn, 1, 0);
-
-	isfunc = 0;
     }
     runhookdef(AFTERTRAPHOOK, NULL);