about summary refs log tree commit diff
path: root/Src/signals.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-09-29 21:46:58 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-09-29 21:46:58 +0000
commite3fd25b18198709348af195dedadaceb88feb568 (patch)
treec79923638294a83398fdda1aef2698deafef0399 /Src/signals.c
parent29db898a6d5eb41b4e3c8624bd1356d02571f5f0 (diff)
downloadzsh-e3fd25b18198709348af195dedadaceb88feb568.tar.gz
zsh-e3fd25b18198709348af195dedadaceb88feb568.tar.xz
zsh-e3fd25b18198709348af195dedadaceb88feb568.zip
25775: fix logical problem with function line numbering inside eval-style traps
Diffstat (limited to 'Src/signals.c')
-rw-r--r--Src/signals.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Src/signals.c b/Src/signals.c
index 2cedeb2b9..ac5ffaa21 100644
--- a/Src/signals.c
+++ b/Src/signals.c
@@ -1077,6 +1077,13 @@ int intrap;
 int trapisfunc;
 
 /*
+ * If the current trap is not a function, at what function depth
+ * did the trap get called?
+ */
+/**/
+int traplocallevel;
+
+/*
  * sig is the signal number.
  * *sigtr is the value to be taken as the field in sigtrapped (since
  *   that may have changed by this point if we are exiting).
@@ -1132,6 +1139,7 @@ dotrapargs(int sig, int *sigtr, void *sigfn)
     /* execsave will save the old trap_return and trap_state */
     execsave();
     breaks = retflag = 0;
+    traplocallevel = locallevel;
     runhookdef(BEFORETRAPHOOK, NULL);
     if (*sigtr & ZSIG_FUNC) {
 	int osc = sfcontext;