summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Src/exec.c2
-rw-r--r--Src/zsh.h2
-rw-r--r--Test/C03traps.ztst10
4 files changed, 18 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 782fe3474..85fd92618 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-08-31 Peter Stephenson <p.w.stephenson@ntlworld.com>
+
+ * 25570: Src/exec.c, Src/zsh.h, Test/C03traps.ztst: line numbers
+ of complex sublists were wrong, plus test; another place to make
+ lineno more consistent.
+
2008-08-31 Andrey Borzenkov <bor@zsh.org>
* users/13169: Src/exec.c: really restore emulation mode when
diff --git a/Src/exec.c b/Src/exec.c
index e9f4bc1e8..06f08ffb8 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1060,7 +1060,7 @@ execlist(Estate state, int dont_change_job, int exiting)
lnp1 = code2;
} else if (wc_code(code2) == WC_SUBLIST) {
if (WC_SUBLIST_FLAGS(code2) == WC_SUBLIST_SIMPLE)
- lnp1 = state->pc[2];
+ lnp1 = state->pc[1];
else
lnp1 = WC_PIPE_LINENO(state->pc[1]);
}
diff --git a/Src/zsh.h b/Src/zsh.h
index ca49c695c..011aa3634 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -1063,7 +1063,7 @@ struct cmdnam {
struct shfunc {
struct hashnode node;
char *filename; /* Name of file located in */
- int lineno; /* line number in above file */
+ zlong lineno; /* line number in above file */
Eprog funcdef; /* function definition */
};
diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst
index 1e0b4088f..f0bfd296a 100644
--- a/Test/C03traps.ztst
+++ b/Test/C03traps.ztst
@@ -429,6 +429,16 @@
1:Skip assignment from DEBUG trap
>5 three
+ fn() {
+ setopt localtraps localoptions debugbeforecmd
+ trap 'print $LINENO' DEBUG
+ [[ a = a ]] && print a is ok
+ }
+ fn
+0:line numbers of complex sublists
+>3
+>a is ok
+
%clean
rm -f TRAPEXIT