diff options
author | Philippe Altherr <philippe.altherr@gmail.com> | 2022-12-03 21:35:51 -0800 |
---|---|---|
committer | Bart Schaefer <schaefer@zsh.org> | 2022-12-03 21:35:51 -0800 |
commit | ab9c579ef9a1ad6482267719f5d031f6a5dbf24e (patch) | |
tree | ca8213bf78fc1673c3951ef70bb53e91706c9d36 /Src/loop.c | |
parent | f253ea6b9d14901e24fa6a376936effad9e6547b (diff) | |
download | zsh-ab9c579ef9a1ad6482267719f5d031f6a5dbf24e.tar.gz zsh-ab9c579ef9a1ad6482267719f5d031f6a5dbf24e.tar.xz zsh-ab9c579ef9a1ad6482267719f5d031f6a5dbf24e.zip |
51098: remove unreachable NOERREXIT_UNTIL_EXEC code and effects
Diffstat (limited to 'Src/loop.c')
-rw-r--r-- | Src/loop.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/Src/loop.c b/Src/loop.c index 7c3e04b8a..61543ed73 100644 --- a/Src/loop.c +++ b/Src/loop.c @@ -569,23 +569,14 @@ execif(Estate state, int do_exec) s = 1; state->pc = next; } + noerrexit = olderrexit; if (run) { - /* we need to ignore lastval until we reach execcmd() */ - if (olderrexit || run == 2) - noerrexit = olderrexit; - else if (lastval) - noerrexit |= NOERREXIT_EXIT | NOERREXIT_RETURN | NOERREXIT_UNTIL_EXEC; - else - noerrexit &= ~ (NOERREXIT_EXIT | NOERREXIT_RETURN); cmdpush(run == 2 ? CS_ELSE : (s ? CS_ELIFTHEN : CS_IFTHEN)); execlist(state, 1, do_exec); cmdpop(); - } else { - noerrexit = olderrexit; - if (!retflag && !errflag) - lastval = 0; - } + } else if (!retflag && !errflag) + lastval = 0; state->pc = end; this_noerrexit = 1; |