diff options
author | Peter Stephenson <pws@zsh.org> | 2016-09-14 10:32:29 +0100 |
---|---|---|
committer | Peter Stephenson <pws@zsh.org> | 2016-09-14 10:33:18 +0100 |
commit | a4b8ee13be494c8732c0348857befe87951a058b (patch) | |
tree | 5db582aeb688e4a1520f205a268765602f5b61e4 /Src/subst.c | |
parent | be4c072cf50ffcc2e2c34e4edbb0e2a78900206b (diff) | |
download | zsh-a4b8ee13be494c8732c0348857befe87951a058b.tar.gz zsh-a4b8ee13be494c8732c0348857befe87951a058b.tar.xz zsh-a4b8ee13be494c8732c0348857befe87951a058b.zip |
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.
Diffstat (limited to 'Src/subst.c')
-rw-r--r-- | Src/subst.c | 7 |
1 files changed, 7 insertions, 0 deletions
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()) { /* |