From 1869eeb393e2499e9949cc3458cdd74685342540 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 13 Dec 2012 10:36:59 +0000 Subject: 30876: fix obscure failures to propagate non-zero status from optimised simple commands within lists --- Src/exec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Src/exec.c') diff --git a/Src/exec.c b/Src/exec.c index 74b14d54d..1ecbc3967 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -1207,6 +1207,9 @@ execlist(Estate state, int dont_change_job, int exiting) } else donedebug = intrap ? 1 : 0; + /* Reset donetrap: this ensures that a trap is only * + * called once for each sublist that fails. */ + donetrap = 0; if (ltype & Z_SIMPLE) { next = state->pc + WC_LIST_SKIP(code); if (donedebug != 2) @@ -1214,9 +1217,6 @@ execlist(Estate state, int dont_change_job, int exiting) state->pc = next; goto sublist_done; } - /* Reset donetrap: this ensures that a trap is only * - * called once for each sublist that fails. */ - donetrap = 0; /* Loop through code followed by &&, ||, or end of sublist. */ code = *state->pc++; -- cgit 1.4.1