1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-28 17:10:59 +01:00

51608: Don't execute commands after "continue &&"

Also ! continue ||
This commit is contained in:
Peter Stephenson 2023-03-29 10:52:05 +01:00
parent 6d40d9b63b
commit 12e5db145b
2 changed files with 38 additions and 2 deletions

View file

@ -982,3 +982,39 @@ F:its expectations.
}
fn
1:! does not affect return status of explicit return
msg=unset
for x in 1 2 3 4 5; do
continue && msg=set && print Not executed
print Not executed, neither.
done
print $msg
0:continue causes immediate continuation
>unset
msg=unset
() {
return && msg=set && print Not executed
print Not executed, not nor neither.
}
print $msg
0:return causes immediate return
>unset
msg=unset
for x in 1 2 3 4 5; do
! continue || msg=set && print Not executed
print Not executed, neither.
done
print $msg
0:! continue causes immediate continuation
>unset
msg=unset
() {
! return || msg=set && print Not executed
print Not executed, not nor neither.
}
print $msg
0:! return causes immediate return
>unset