From 3af55c858f12fe72eebd6addca89bf6395cae826 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 9 Jul 2015 14:58:10 +0100 Subject: 35751: Fix ERR_RETURN and ERR_EXIT in "else" --- Src/exec.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Src') diff --git a/Src/exec.c b/Src/exec.c index 960601f29..4eee82bf1 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -1351,7 +1351,13 @@ execlist(Estate state, int dont_change_job, int exiting) state->pc--; sublist_done: - noerrexit = oldnoerrexit; + /* + * See hairy code near the end of execif() for the + * following. "noerrexit == 2" only applies until + * we hit execcmd on the way down. We're now + * on the way back up, so don't restore it. + */ + noerrexit = (oldnoerrexit == 2) ? 0 : oldnoerrexit; if (sigtrapped[SIGDEBUG] && !isset(DEBUGBEFORECMD) && !donedebug) { /* -- cgit 1.4.1