summaryrefslogtreecommitdiff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2011-08-17 20:26:05 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2011-08-17 20:26:05 +0000
commit85b00bb0f7c60b9f4da5261633221cc200a0ab7f (patch)
tree598aa356ec9a9e703ecd3223c54690ec259e42c8 /Src/exec.c
parent815e52cdbf0a62bf795d5af8e7089aaca5709806 (diff)
downloadzsh-85b00bb0f7c60b9f4da5261633221cc200a0ab7f.tar.gz
zsh-85b00bb0f7c60b9f4da5261633221cc200a0ab7f.zip
29703: crash when failing to parse process substitutions
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/Src/exec.c b/Src/exec.c
index a9164bc64..3c51a3d42 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -3755,7 +3755,15 @@ parsecmd(char *cmd, char **eptr)
for (str = cmd + 2; *str && *str != Outpar; str++);
if (!*str || cmd[1] != Inpar) {
- zerr("oops.");
+ /*
+ * This can happen if the expression is being parsed
+ * inside another construct, e.g. as a value within ${..:..} etc.
+ * So print a proper error message instead of the not very
+ * useful but traditional "oops".
+ */
+ char *errstr = dupstrpfx(cmd, 2);
+ untokenize(errstr);
+ zerr("unterminated `%s...)'", errstr);
return NULL;
}
*str = '\0';