mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-10 12:40:58 +02:00
32568: consistency in handling of errflag condition during substitutions
Affects for/select word lists, function definition name position, and anonymous function argument lists.
This commit is contained in:
parent
8189e12312
commit
848badaa5f
3 changed files with 27 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2014-04-20 Barton E. Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
|
* 32568: Src/exec.c, Src/loop.c: consistency in handling of errflag
|
||||||
|
condition during substitutions in for/select word lists, function
|
||||||
|
definition name position, and anonymous function argument lists.
|
||||||
|
|
||||||
2014-04-17 Barton E. Schaefer <schaefer@zsh.org>
|
2014-04-17 Barton E. Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
* Andrew Waldron: 32552 (updated by 32560): Src/exec.c,
|
* Andrew Waldron: 32552 (updated by 32560): Src/exec.c,
|
||||||
|
|
11
Src/exec.c
11
Src/exec.c
|
@ -4243,8 +4243,10 @@ execfuncdef(Estate state, UNUSED(int do_exec))
|
||||||
|
|
||||||
if (htok && names) {
|
if (htok && names) {
|
||||||
execsubst(names);
|
execsubst(names);
|
||||||
if (errflag)
|
if (errflag) {
|
||||||
|
state->pc = end;
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!names || (s = (char *) ugetnode(names))) {
|
while (!names || (s = (char *) ugetnode(names))) {
|
||||||
|
@ -4301,8 +4303,13 @@ execfuncdef(Estate state, UNUSED(int do_exec))
|
||||||
end += *state->pc++;
|
end += *state->pc++;
|
||||||
args = ecgetlist(state, *state->pc++, EC_DUPTOK, &htok);
|
args = ecgetlist(state, *state->pc++, EC_DUPTOK, &htok);
|
||||||
|
|
||||||
if (htok && args)
|
if (htok && args) {
|
||||||
execsubst(args);
|
execsubst(args);
|
||||||
|
if (errflag) {
|
||||||
|
state->pc = end;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!args)
|
if (!args)
|
||||||
args = newlinklist();
|
args = newlinklist();
|
||||||
|
|
14
Src/loop.c
14
Src/loop.c
|
@ -87,8 +87,13 @@ execfor(Estate state, int do_exec)
|
||||||
state->pc = end;
|
state->pc = end;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (htok)
|
if (htok) {
|
||||||
execsubst(args);
|
execsubst(args);
|
||||||
|
if (errflag) {
|
||||||
|
state->pc = end;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
char **x;
|
char **x;
|
||||||
|
|
||||||
|
@ -223,8 +228,13 @@ execselect(Estate state, UNUSED(int do_exec))
|
||||||
state->pc = end;
|
state->pc = end;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (htok)
|
if (htok) {
|
||||||
execsubst(args);
|
execsubst(args);
|
||||||
|
if (errflag) {
|
||||||
|
state->pc = end;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!args || empty(args)) {
|
if (!args || empty(args)) {
|
||||||
state->pc = end;
|
state->pc = end;
|
||||||
|
|
Loading…
Reference in a new issue