From dd3ba3d5991f5c99334742147fb2213b8c400a42 Mon Sep 17 00:00:00 2001 From: Philippe Altherr Date: Sat, 3 Dec 2022 20:44:10 -0800 Subject: 51001: fix for ERR_EXIT following shell function; update tests --- Src/exec.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'Src/exec.c') diff --git a/Src/exec.c b/Src/exec.c index d8501ca68..43df8211a 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -5932,15 +5932,6 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) * This function is forced to return. */ retflag = 0; - /* - * The calling function isn't necessarily forced to return, - * but it should be made sensitive to ERR_EXIT and - * ERR_RETURN as the assumptions we made at the end of - * constructs within this function no longer apply. If - * there are cases where this is not true, they need adding - * to C03traps.ztst. - */ - this_noerrexit = 0; breaks = funcsave->breaks; } freearray(pparams); @@ -6010,6 +6001,7 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) trap_return++; ret = lastval; noerrexit = funcsave->noerrexit; + this_noerrexit = 0; if (noreturnval) { lastval = funcsave->lastval; numpipestats = funcsave->numpipestats; -- cgit 1.4.1