diff options
Diffstat (limited to 'Src')
-rw-r--r-- | Src/exec.c | 10 | ||||
-rw-r--r-- | Src/subst.c | 2 |
2 files changed, 11 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'; diff --git a/Src/subst.c b/Src/subst.c index 1b0097001..66e0bbe77 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -162,6 +162,8 @@ stringsubst(LinkList list, LinkNode node, int ssub, int asssub) subst = getproc(str, &rest); /* <(...) or >(...) */ else subst = getoutputfile(str, &rest); /* =(...) */ + if (errflag) + return NULL; if (!subst) subst = ""; |