mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Fix side effect to exit status of DEBUG trap in comsub
This fixes the following: trap ':' DEBUG r=$(exit 123) echo $? # Expected 123, but actually 0. Thanks to Koichi Nakashima for the report and reproducer. src/cmd/ksh93/sh/fault.c: sh_trap(): - Restore the saved current exit status (exitval) for all traps. Do not except the DEBUG trap from doing that. I've no idea why this exception was made, but it's not correct. src/cmd/ksh93/tests/basic.sh: - Add tests. Makes progress on: https://github.com/ksh93/ksh/issues/155
This commit is contained in:
parent
5ee290c7a8
commit
d00b4b39f6
4 changed files with 19 additions and 2 deletions
5
NEWS
5
NEWS
|
@ -3,6 +3,11 @@ For full details, see the git log at: https://github.com/ksh93/ksh
|
|||
|
||||
Any uppercase BUG_* names are modernish shell bug IDs.
|
||||
|
||||
2021-01-20:
|
||||
|
||||
- Fixed: executing a DEBUG trap in a command substitution had side effects
|
||||
on the exit status ($?) of non-trap commands.
|
||||
|
||||
2021-01-19:
|
||||
|
||||
- Fixed a crash when using 'cd' in a virtual/non-forking subshell in a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue