summaryrefslogtreecommitdiff
path: root/Src/parse.c
diff options
context:
space:
mode:
authorAndrew Waldron <a.a.w@gmx.us>2014-04-18 07:30:36 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2014-04-18 07:30:36 -0700
commit8189e12312ede991827efc6683b7ce8463deb0bf (patch)
tree04d1a5c5a2ebc37edf87158fbc4d983578cbc0ed /Src/parse.c
parentd9935915b73082c70d543ea098ecea9e95068659 (diff)
downloadzsh-8189e12312ede991827efc6683b7ce8463deb0bf.tar.gz
zsh-8189e12312ede991827efc6683b7ce8463deb0bf.zip
32552 (updated by 32560): fix segfault when using process substitution in anonymous function argument list
Also disallow process substitution in function name position.
Diffstat (limited to 'Src/parse.c')
-rw-r--r--Src/parse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Src/parse.c b/Src/parse.c
index f0d0855d3..530a07033 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -1471,7 +1471,6 @@ par_funcdef(int *complex)
if (num == 0) {
/* Anonymous function, possibly with arguments */
incmdpos = 0;
- *complex = 1;
}
zshlex();
} else if (unset(SHORTLOOPS)) {
@@ -1503,6 +1502,7 @@ par_funcdef(int *complex)
num++;
zshlex();
}
+ *complex = (num > 0);
ecbuf[parg] = ecused - parg; /*?*/
ecbuf[parg+1] = num;
}
@@ -1736,7 +1736,6 @@ par_simple(int *complex, int nr)
if (argc == 0) {
/* Anonymous function, possibly with arguments */
incmdpos = 0;
- *complex = 1;
}
zshlex();
} else {
@@ -1776,6 +1775,7 @@ par_simple(int *complex, int nr)
argc++;
zshlex();
}
+ *complex = (argc > 0);
ecbuf[parg] = ecused - parg; /*?*/
ecbuf[parg+1] = argc;
}