1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-05-19 11:11:31 +02:00

51134: ! return doesn't change the return status

This commit is contained in:
Peter Stephenson 2022-12-12 10:30:13 +00:00
parent 14559421e2
commit 67d4bf5bb9
2 changed files with 13 additions and 1 deletions

View file

@ -1961,7 +1961,7 @@ execpline(Estate state, wordcode slcode, int how, int last1)
}
else
unqueue_signals();
if ((slflags & WC_SUBLIST_NOT) && !errflag)
if ((slflags & WC_SUBLIST_NOT) && !errflag && !retflag)
lastval = !lastval;
}
if (!pline_level)

View file

@ -970,3 +970,15 @@ F:its expectations.
0:Non-interactive shell command input is line buffered
>Value is first
>Value is second
fn() {
! false
}
0:! inverts the status of implicit return
fn () {
false
! return
}
fn
1:! does not affect return status of explicit return