1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-06-01 21:06:04 +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:
Barton E. Schaefer 2014-04-20 10:27:15 -07:00
parent 8189e12312
commit 848badaa5f
3 changed files with 27 additions and 4 deletions

View File

@ -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>
* Andrew Waldron: 32552 (updated by 32560): Src/exec.c,

View File

@ -4243,8 +4243,10 @@ execfuncdef(Estate state, UNUSED(int do_exec))
if (htok && names) {
execsubst(names);
if (errflag)
if (errflag) {
state->pc = end;
return 1;
}
}
while (!names || (s = (char *) ugetnode(names))) {
@ -4301,8 +4303,13 @@ execfuncdef(Estate state, UNUSED(int do_exec))
end += *state->pc++;
args = ecgetlist(state, *state->pc++, EC_DUPTOK, &htok);
if (htok && args)
if (htok && args) {
execsubst(args);
if (errflag) {
state->pc = end;
return 1;
}
}
if (!args)
args = newlinklist();

View File

@ -87,8 +87,13 @@ execfor(Estate state, int do_exec)
state->pc = end;
return 0;
}
if (htok)
if (htok) {
execsubst(args);
if (errflag) {
state->pc = end;
return 1;
}
}
} else {
char **x;
@ -223,8 +228,13 @@ execselect(Estate state, UNUSED(int do_exec))
state->pc = end;
return 0;
}
if (htok)
if (htok) {
execsubst(args);
if (errflag) {
state->pc = end;
return 1;
}
}
}
if (!args || empty(args)) {
state->pc = end;