summaryrefslogtreecommitdiffhomepage
path: root/tests/zash/errtrap-exec.exp
Commit message (Collapse)AuthorAgeFilesLines
* fix(exec): run the ERR trap when the last command is exec'dSean Kurtz2 days1-0/+10
`trap "echo ERR" ERR; /bin/false` printed nothing: the shell replaced itself with the failing program and was gone before the trap could run. The same shortcut made `trap ... ; (/bin/false)` silently skip it. trap_after_last() is true when the EXIT or the ERR trap is set, and both the exec shortcut in run_external() and the in-process subshell shortcut in eval_subshell() now use it instead of trap_has_exit(). tests/zash/errtrap-exec.sh covers the external command, a builtin, a subshell and the two traps together; the first and third lines fail without the change. ksh93 prints ERR for all four.