about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorPhilippe Altherr <philippe.altherr@gmail.com>2022-12-03 20:44:10 -0800
committerBart Schaefer <schaefer@zsh.org>2022-12-03 20:44:10 -0800
commitdd3ba3d5991f5c99334742147fb2213b8c400a42 (patch)
treebc05729239d27ea7d91970ee6e76948fe691d1ed /Src/exec.c
parentd47b8480f0eb883d54fcbef22999bf26d13d56a4 (diff)
downloadzsh-dd3ba3d5991f5c99334742147fb2213b8c400a42.tar.gz
zsh-dd3ba3d5991f5c99334742147fb2213b8c400a42.tar.xz
zsh-dd3ba3d5991f5c99334742147fb2213b8c400a42.zip
51001: fix for ERR_EXIT following shell function; update tests
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c10
1 files changed, 1 insertions, 9 deletions
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;