summary refs log tree commit diff
path: root/src/histedit.c
diff options
context:
space:
mode:
authorAntonio Ospite <ao2@ao2.it>2018-10-16 14:09:52 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2018-12-14 13:48:02 +0800
commit06204f0c9f539fcb8cb532166656e80b81bd689a (patch)
treef911d73f75ee0d033ecb088ad914a10f08fe499e /src/histedit.c
parentexpand: Fix multiple issues with EXP_DISCARD in evalvar (diff)
downloaddash-06204f0c9f539fcb8cb532166656e80b81bd689a.tar.gz
dash-06204f0c9f539fcb8cb532166656e80b81bd689a.zip
eval: make traps work when "set -e" is enabled
When "set -e" is enabled traps are not always executed, in particular
the EXIT trap is not executed when the shell exits on an unhandled
error.

Consider the following test script:

  #!/bin/dash

  set -e

  trap 'ret=$?; echo "EXIT: $ret"' EXIT
  trap 'exit 2' HUP INT QUIT PIPE TERM

  read variable

By pressing Ctrl-C one would expect the EXIT trap to be called, as it is
the case with other shells (bash, zsh), but dash does not do it.

By calling dotrap() before jumping to the exit path when checkexit is
not zero, dash behaves like other shells.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'src/histedit.c')
0 files changed, 0 insertions, 0 deletions
>build: Remove added x509_verify.3 links 3.3.2June McEnroe 2021-04-18tls: Use EC_KEY_set_ex_dataJune McEnroe 2021-04-18Import LibreSSL 3.3.2June McEnroe 2021-03-05Bump version to 3.3.1p1 3.3.1p1June McEnroe 2021-03-05build: Add OpenSSL includes to libcompatJune McEnroe 2020-12-15Import LibreSSL 3.3.1June McEnroe 2020-11-24Import LibreSSL 3.3.0June McEnroe 2020-10-22Import LibreSSL 3.2.2June McEnroe 2020-09-29Import LibreSSL 3.2.1June McEnroe 2020-09-29import: Add m4/ax_add_fortify_source.m4June McEnroe 2020-08-05build: Add README.7 to EXTRA_DIST 3.2.0June McEnroe 2020-08-03doc: Indicate that only OpenSSL 1.1.1b and newer workJune McEnroe