From a4b8ee13be494c8732c0348857befe87951a058b Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Wed, 14 Sep 2016 10:32:29 +0100 Subject: zsh-users/21903: Fix ${...?...} in interactive shell. On failure should abort back to top level, but we reset the error flag around commands. Add a hard error flag that's only reset at top level. --- Src/subst.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Src/subst.c') diff --git a/Src/subst.c b/Src/subst.c index 1c2027f32..92fde4598 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -2922,6 +2922,13 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags, if (isset(EXECOPT)) { *idend = '\0'; zerr("%s: %s", idbeg, *s ? s : "parameter not set"); + /* + * In interactive shell we need to return to + * top-level prompt --- don't clear this error + * after handling a command as we do with + * most errors. + */ + errflag |= ERRFLAG_HARD; if (!interact) { if (mypid == getpid()) { /* -- cgit 1.4.1