sh: Fix execution of multiple statements in a trap when evalskip is set
authorPeter Avalos <pavalos@dragonflybsd.org>
Sun, 5 Feb 2012 20:07:56 +0000 (12:07 -0800)
committerPeter Avalos <pavalos@dragonflybsd.org>
Sun, 5 Feb 2012 21:04:02 +0000 (13:04 -0800)
commitb10eb092c3f3d21c311ae15513e9a4b7db195c90
tree12b26b9461dd177d7bce9cb6cccc4d137499e32a
parent4181c918716ab3dbca834e418290b3f961fd9bbc
sh: Fix execution of multiple statements in a trap when evalskip is set

Before this fix, only the first statement of the trap was executed if
evalskip was set. This is for example the case when:
    o  "-e" is set for this shell
    o  a trap is set on EXIT
    o  a function returns 1 and causes the script to abort

Obtained-from:  FreeBSD 230212
(cherry picked from commit a1cf61ab1fd76b3e90e17fc4bc03767015deb2e1)
bin/sh/eval.c
bin/sh/eval.h
bin/sh/trap.c
tools/regression/bin/sh/builtins/trap10.0 [new file with mode: 0644]
tools/regression/bin/sh/builtins/trap11.0 [new file with mode: 0644]