mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-13 01:31:18 +02:00
unposted: back out 36707, add test case for 36766
This commit is contained in:
parent
b581c3fece
commit
cb26e11c70
4 changed files with 21 additions and 7 deletions
|
@ -1,5 +1,9 @@
|
||||||
2015-10-03 Barton E. Schaefer <schaefer@zsh.org>
|
2015-10-03 Barton E. Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
|
* unposted (cf. 36696): Test/C03traps.ztst: test case for 36766
|
||||||
|
|
||||||
|
* unposted: Src/exec.c, Src/loop.c: back out 36707, fixed by 36766
|
||||||
|
|
||||||
* 36766: Src/exec.c: fix incorrect reset of noerrexit during
|
* 36766: Src/exec.c: fix incorrect reset of noerrexit during
|
||||||
"if" conditions
|
"if" conditions
|
||||||
|
|
||||||
|
|
|
@ -1409,7 +1409,7 @@ sublist_done:
|
||||||
exit(lastval);
|
exit(lastval);
|
||||||
}
|
}
|
||||||
if (errreturn) {
|
if (errreturn) {
|
||||||
retflag = 2;
|
retflag = 1;
|
||||||
breaks = loops;
|
breaks = loops;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -552,12 +552,8 @@ execif(Estate state, int do_exec)
|
||||||
run = 1;
|
run = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (retflag) {
|
if (retflag)
|
||||||
if (retflag == 2)
|
|
||||||
retflag = 0; /* Never ERR_RETURN here */
|
|
||||||
else
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
s = 1;
|
s = 1;
|
||||||
state->pc = next;
|
state->pc = next;
|
||||||
}
|
}
|
||||||
|
|
|
@ -450,6 +450,20 @@
|
||||||
fn
|
fn
|
||||||
1:ERRRETURN in "else" branch (regression test)
|
1:ERRRETURN in "else" branch (regression test)
|
||||||
|
|
||||||
|
$ZTST_testdir/../Src/zsh -f =(<<<"
|
||||||
|
if false; then
|
||||||
|
:
|
||||||
|
else
|
||||||
|
if [[ -n '' ]]; then
|
||||||
|
a=2
|
||||||
|
fi
|
||||||
|
print Yes
|
||||||
|
fi
|
||||||
|
")
|
||||||
|
0:ERRRETURN when false "if" is the first statement in an "else" (regression)
|
||||||
|
>Yes
|
||||||
|
F:Must be tested with a top-level script rather than source or function
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
|
|
||||||
rm -f TRAPEXIT
|
rm -f TRAPEXIT
|
||||||
|
|
Loading…
Reference in a new issue