mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-05-17 13:36:04 +02:00
51608: Don't execute commands after "continue &&"
Also ! continue ||
This commit is contained in:
parent
6d40d9b63b
commit
12e5db145b
|
@ -1491,7 +1491,7 @@ execlist(Estate state, int dont_change_job, int exiting)
|
||||||
* we find a sublist followed by ORNEXT. */
|
* we find a sublist followed by ORNEXT. */
|
||||||
if ((ret = ((WC_SUBLIST_FLAGS(code) & WC_SUBLIST_SIMPLE) ?
|
if ((ret = ((WC_SUBLIST_FLAGS(code) & WC_SUBLIST_SIMPLE) ?
|
||||||
execsimple(state) :
|
execsimple(state) :
|
||||||
execpline(state, code, Z_SYNC, 0)))) {
|
execpline(state, code, Z_SYNC, 0))) || breaks) {
|
||||||
state->pc = next;
|
state->pc = next;
|
||||||
code = *state->pc++;
|
code = *state->pc++;
|
||||||
next = state->pc + WC_SUBLIST_SKIP(code);
|
next = state->pc + WC_SUBLIST_SKIP(code);
|
||||||
|
@ -1524,7 +1524,7 @@ execlist(Estate state, int dont_change_job, int exiting)
|
||||||
* we find a sublist followed by ANDNEXT. */
|
* we find a sublist followed by ANDNEXT. */
|
||||||
if (!(ret = ((WC_SUBLIST_FLAGS(code) & WC_SUBLIST_SIMPLE) ?
|
if (!(ret = ((WC_SUBLIST_FLAGS(code) & WC_SUBLIST_SIMPLE) ?
|
||||||
execsimple(state) :
|
execsimple(state) :
|
||||||
execpline(state, code, Z_SYNC, 0)))) {
|
execpline(state, code, Z_SYNC, 0))) || breaks) {
|
||||||
state->pc = next;
|
state->pc = next;
|
||||||
code = *state->pc++;
|
code = *state->pc++;
|
||||||
next = state->pc + WC_SUBLIST_SKIP(code);
|
next = state->pc + WC_SUBLIST_SKIP(code);
|
||||||
|
|
|
@ -982,3 +982,39 @@ F:its expectations.
|
||||||
}
|
}
|
||||||
fn
|
fn
|
||||||
1:! does not affect return status of explicit return
|
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
|
||||||
|
|
Loading…
Reference in New Issue