summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2014-04-20 10:27:15 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2014-04-20 10:27:15 -0700
commit848badaa5f0a18ca3388016d49ffc340b6c2d0c6 (patch)
tree6588e5f278aeb789405651e5d3c2f0c7409bf778
parent8189e12312ede991827efc6683b7ce8463deb0bf (diff)
downloadzsh-848badaa5f0a18ca3388016d49ffc340b6c2d0c6.tar.gz
zsh-848badaa5f0a18ca3388016d49ffc340b6c2d0c6.zip
32568: consistency in handling of errflag condition during substitutions
Affects for/select word lists, function definition name position, and anonymous function argument lists.
-rw-r--r--ChangeLog6
-rw-r--r--Src/exec.c11
-rw-r--r--Src/loop.c14
3 files changed, 27 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index f8711ee31..4e79faae4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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,
diff --git a/Src/exec.c b/Src/exec.c
index d821d164f..8249deff2 100644
--- a/Src/exec.c
+++ b/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();
diff --git a/Src/loop.c b/Src/loop.c
index 90a0761b3..dc8f2320f 100644
--- a/Src/loop.c
+++ b/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;