From 2421fe859969171914aac4e9280b96db1b173763 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 17 Sep 2002 10:46:30 +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/exec.c') diff --git a/Src/exec.c b/Src/exec.c index f1206e93c..4ed4f0671 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -848,8 +848,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; @@ -874,8 +881,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