From 41b50445eab2eb71c4446f85e368a273b52c39a3 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 17 Sep 2002 10:42:17 +0000 Subject: 17673: Fix bug with &&s and ||s in complex constructs --- Src/exec.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'Src') diff --git a/Src/exec.c b/Src/exec.c index 9033e146d..ca7b2061f 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -851,8 +851,15 @@ execlist(Estate state, int dont_change_job, int exiting) * for this sublist. */ donetrap = 1; goto sublist_done; - } else if (WC_SUBLIST_TYPE(code) == WC_SUBLIST_END) + } else if (WC_SUBLIST_TYPE(code) == WC_SUBLIST_END) { donetrap = 1; + /* + * Treat this in the same way as if we reached + * the end of the sublist normally. + */ + state->pc = next; + goto sublist_done; + } } cmdpush(CS_CMDAND); break; @@ -877,8 +884,15 @@ execlist(Estate state, int dont_change_job, int exiting) * for this sublist. */ donetrap = 1; goto sublist_done; - } else if (WC_SUBLIST_TYPE(code) == WC_SUBLIST_END) + } else if (WC_SUBLIST_TYPE(code) == WC_SUBLIST_END) { donetrap = 1; + /* + * Treat this in the same way as if we reached + * the end of the sublist normally. + */ + state->pc = next; + goto sublist_done; + } } cmdpush(CS_CMDOR); break; -- cgit 1.4.1