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:
parent
8189e12312
commit
848badaa5f
|
@ -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,
|
||||
|
|
11
Src/exec.c
11
Src/exec.c
|
@ -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();
|
||||
|
|
14
Src/loop.c
14
Src/loop.c
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue