Skip to content

Fix default exit status of exit built-in in trap action#162

Merged
magicant merged 1 commit into
trunkfrom
posix-exit-status
Apr 24, 2025
Merged

Fix default exit status of exit built-in in trap action#162
magicant merged 1 commit into
trunkfrom
posix-exit-status

Conversation

@magicant

Copy link
Copy Markdown
Owner

This commit fixes the behavior of the exit built-in when used in a trap action without an operand. Previously, the shell would exit with the exit status of the last command executed in the trap action. This commit changes it to exit with the exit status of the last command executed before the trap action, as per POSIX specifications.

This commit fixes the behavior of the `exit` built-in when used in a
trap action without an operand. Previously, the shell would exit with
the exit status of the last command executed in the trap action. This
commit changes it to exit with the exit status of the last command
executed before the trap action, as per POSIX specifications.
@magicant magicant added the bug Something isn't working label Apr 23, 2025
@magicant magicant added this to the 2.59 milestone Apr 23, 2025
@magicant magicant self-assigned this Apr 23, 2025
@magicant
magicant marked this pull request as ready for review April 24, 2025 13:39
@magicant
magicant merged commit 9077c30 into trunk Apr 24, 2025
@magicant
magicant deleted the posix-exit-status branch April 24, 2025 13:40
@magicant magicant mentioned this pull request May 8, 2025
56 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant