Subshell exit status broken in EXIT traps
Subshells always return status 0 in EXIT traps.
$ yash -c 'trap "(false) && echo BUG" EXIT' BUG $ yash -c 'trap "(false); echo \$?" EXIT' 0
Workaround: if an explicit 'exit' is given, it works as expected.
$ yash -c 'trap "(false; exit \$?); echo \$?" EXIT' 1
Background info: dash has a similar bug, and the relevant thread there is probably worth following.
Thanks for the info.
Added some tests in r3934 and fixed in r3935 .
Subshells always return status 0 in EXIT traps.
Workaround: if an explicit 'exit' is given, it works as expected.