about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorPhilippe Altherr <philippe.altherr@gmail.com>2022-12-03 21:46:42 -0800
committerBart Schaefer <schaefer@zsh.org>2022-12-03 21:46:42 -0800
commit8086f106159c2e9fc562b5ce88b8aefdb5fe5d23 (patch)
tree558ea5db4b0546a466d62389d0d058915d674573 /Src/exec.c
parentab9c579ef9a1ad6482267719f5d031f6a5dbf24e (diff)
downloadzsh-8086f106159c2e9fc562b5ce88b8aefdb5fe5d23.tar.gz
zsh-8086f106159c2e9fc562b5ce88b8aefdb5fe5d23.tar.xz
zsh-8086f106159c2e9fc562b5ce88b8aefdb5fe5d23.zip
51094: consistent use of bit-manipulation for noerrexit value changes
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 1dd569019..1810fca5e 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1415,7 +1415,7 @@ execlist(Estate state, int dont_change_job, int exiting)
 	    int oerrexit_opt = opts[ERREXIT];
 	    Param pm;
 	    opts[ERREXIT] = 0;
-	    noerrexit = NOERREXIT_EXIT | NOERREXIT_RETURN;
+	    noerrexit |= NOERREXIT_EXIT | NOERREXIT_RETURN;
 	    if (ltype & Z_SIMPLE) /* skip the line number */
 		pc2++;
 	    pm = assignsparam("ZSH_DEBUG_CMD",
@@ -1472,7 +1472,7 @@ execlist(Estate state, int dont_change_job, int exiting)
 	    next = state->pc + WC_SUBLIST_SKIP(code);
 	    /* suppress errexit for commands before && and || and after ! */
 	    if (isandor || isnot)
-		noerrexit = NOERREXIT_EXIT | NOERREXIT_RETURN;
+		noerrexit |= NOERREXIT_EXIT | NOERREXIT_RETURN;
 	    switch (WC_SUBLIST_TYPE(code)) {
 	    case WC_SUBLIST_END:
 		/* End of sublist; just execute, ignoring status. */
@@ -1568,7 +1568,7 @@ sublist_done:
 	     */
 	    int oerrexit_opt = opts[ERREXIT];
 	    opts[ERREXIT] = 0;
-	    noerrexit = NOERREXIT_EXIT | NOERREXIT_RETURN;
+	    noerrexit |= NOERREXIT_EXIT | NOERREXIT_RETURN;
 	    exiting = donetrap;
 	    ret = lastval;
 	    dotrap(SIGDEBUG);