mirror of
https://git.code.sf.net/p/zsh/code
synced 2026-04-18 06:53:35 -04:00
25405: return status from anonymous functions was not handled
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
2008-08-06 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 25405: Src/exec.c: return value was not set from anonymous
|
||||
functions.
|
||||
|
||||
* 25400: Test/C03traps.ztst: Rocky's test for 25385
|
||||
|
||||
2008-08-05 Peter Stephenson <pws@csr.com>
|
||||
|
||||
@@ -3870,7 +3870,7 @@ execfuncdef(Estate state, UNUSED(int do_exec))
|
||||
{
|
||||
Shfunc shf;
|
||||
char *s = NULL;
|
||||
int signum, nprg, sbeg, nstrs, npats, len, plen, i, htok = 0;
|
||||
int signum, nprg, sbeg, nstrs, npats, len, plen, i, htok = 0, ret = 0;
|
||||
Wordcode beg = state->pc, end;
|
||||
Eprog prog;
|
||||
Patprog *pp;
|
||||
@@ -3941,6 +3941,7 @@ execfuncdef(Estate state, UNUSED(int do_exec))
|
||||
addlinknode(args, shf->node.nam);
|
||||
|
||||
execshfunc(shf, args);
|
||||
ret = lastval;
|
||||
break;
|
||||
} else {
|
||||
/* is this shell function a signal trap? */
|
||||
@@ -3963,7 +3964,7 @@ execfuncdef(Estate state, UNUSED(int do_exec))
|
||||
}
|
||||
}
|
||||
state->pc = end;
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Main entry point to execute a shell function. */
|
||||
|
||||
Reference in New Issue
Block a user