mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-09-28 15:01:21 +02:00
41608 (plus tests): restore ERR_EXIT before function.
There was an exception to the usual ERR_EXIT pattern that causes problems when executing a function in an else branch. It seems the exception is no longer needed as the regression tests pass without it.
This commit is contained in:
parent
8b4d2329c7
commit
7d1877da4e
@ -1,3 +1,8 @@
|
||||
2017-08-27 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||
|
||||
* 41608 (plus tests): Src/exec.c, Test/C03traps.ztst: ERR_EXIT
|
||||
behaviour restored when executing a function in body of else.
|
||||
|
||||
2017-08-29 Андрей Стоцкий (_RuRo_) <ruro.ruro@ya.ru>
|
||||
|
||||
* 41618: Completion/Unix/Command/_todo.sh: Added some arguments
|
||||
|
@ -3025,7 +3025,7 @@ execcmd_exec(Estate state, Execcmd_params eparams,
|
||||
preargs = NULL;
|
||||
|
||||
/* if we get this far, it is OK to pay attention to lastval again */
|
||||
if ((noerrexit & NOERREXIT_UNTIL_EXEC) && !is_shfunc)
|
||||
if (noerrexit & NOERREXIT_UNTIL_EXEC)
|
||||
noerrexit = 0;
|
||||
|
||||
/* Do prefork substitutions.
|
||||
|
@ -465,6 +465,41 @@
|
||||
)
|
||||
1:ERREXIT in loop with simple commands
|
||||
|
||||
(set -e
|
||||
f()
|
||||
{
|
||||
false && false
|
||||
}
|
||||
if false; then
|
||||
:
|
||||
else
|
||||
# ERR_EXIT should trigger on return from function, not in function.
|
||||
f
|
||||
echo Fail 1
|
||||
echo Fail 2
|
||||
f
|
||||
echo Fail 3
|
||||
fi)
|
||||
1:ERREXIT with false from inside && within function
|
||||
|
||||
(set -e
|
||||
f()
|
||||
{
|
||||
}
|
||||
if false; then
|
||||
:
|
||||
else
|
||||
f
|
||||
echo Succeed 1
|
||||
echo Succeed 2
|
||||
f
|
||||
echo Succeed 3
|
||||
fi)
|
||||
0:ERREXIT not triggered on empty function after false in if.
|
||||
>Succeed 1
|
||||
>Succeed 2
|
||||
>Succeed 3
|
||||
|
||||
fn() {
|
||||
emulate -L zsh
|
||||
setopt errreturn
|
||||
|
Loading…
Reference in New Issue
Block a user