Skip to content

Commit

Permalink
Parital revert to fix a test failure in functions.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnoKing committed Jan 17, 2024
1 parent 31d2d24 commit 2a1ec61
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cmd/ksh93/bltins/trap.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ int b_trap(int argc,char *argv[],Shbltin_t *context)
* Set a flag for sh_exec() to disable exec-without-fork optimizations if any trap is set and non-empty.
* (In ksh functions, there may be parent scope traps, so do not reset to 0 if in a ksh function.)
*/
if(sh.infunction!=FUN_KSH)
if(sh.fn_depth==0)
sh.st.trapdontexec = 0;
if(!sh.st.trapdontexec)
{
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/sh/macro.c
Original file line number Diff line number Diff line change
Expand Up @@ -2856,7 +2856,7 @@ static char *special(int c)
case '?':
return ltos(sh.savexit);
case 0:
if(sh_isstate(SH_PROFILE) || sh.infunction!=FUN_KSH || !sh.st.cmdname)
if(sh_isstate(SH_PROFILE) || sh.fn_depth==0 || !sh.st.cmdname)
return sh.shname;
else
return sh.st.cmdname;
Expand Down

0 comments on commit 2a1ec61

Please sign in to comment.