summaryrefslogtreecommitdiff
path: root/Src/loop.c
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2017-09-12 23:22:34 +0200
committerAxel Beckert <abe@deuxchevaux.org>2017-09-12 23:22:34 +0200
commit4aaf06e6678dcead65d7226bd6bde3cffeb2cb2e (patch)
tree5c8e2ac2c9a85e2e6568aed7120372e6efa074ac /Src/loop.c
parentf33de64abf57611e59df72da230f3d0d6760c4c5 (diff)
parent6ff4787e830f8edb3a7e32490a88a131e4b62f7f (diff)
downloadzsh-4aaf06e6678dcead65d7226bd6bde3cffeb2cb2e.tar.gz
zsh-4aaf06e6678dcead65d7226bd6bde3cffeb2cb2e.zip
Merge tag 'zsh-5.4.2' into debian
Release 5.4.2
Diffstat (limited to 'Src/loop.c')
-rw-r--r--Src/loop.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Src/loop.c b/Src/loop.c
index f7eae307b..4859c976b 100644
--- a/Src/loop.c
+++ b/Src/loop.c
@@ -542,7 +542,7 @@ execif(Estate state, int do_exec)
end = state->pc + WC_IF_SKIP(code);
if (!noerrexit)
- noerrexit = 1;
+ noerrexit = NOERREXIT_EXIT | NOERREXIT_RETURN;
while (state->pc < end) {
code = *state->pc++;
if (wc_code(code) != WC_IF ||
@@ -567,7 +567,12 @@ execif(Estate state, int do_exec)
if (run) {
/* we need to ignore lastval until we reach execcmd() */
- noerrexit = olderrexit ? olderrexit : lastval ? 2 : 0;
+ if (olderrexit)
+ noerrexit = olderrexit;
+ else if (lastval)
+ noerrexit = NOERREXIT_EXIT | NOERREXIT_RETURN | NOERREXIT_UNTIL_EXEC;
+ else
+ noerrexit = 0;
cmdpush(run == 2 ? CS_ELSE : (s ? CS_ELIFTHEN : CS_IFTHEN));
execlist(state, 1, do_exec);
cmdpop();