diff options
| author | Peter Stephenson <pws@zsh.org> | 2016-02-17 10:40:55 +0000 |
|---|---|---|
| committer | Peter Stephenson <pws@zsh.org> | 2016-02-17 10:40:55 +0000 |
| commit | ab74c86edb30fa04fda5fe7fa01e404334f7c2b0 (patch) | |
| tree | 096002145a76bca90e09c2dc511008f33145acc2 /Test | |
| parent | users/21256 + workers/37965: New math functions min(), max(), sum(), provided... (diff) | |
| download | zsh-ab74c86edb30fa04fda5fe7fa01e404334f7c2b0.tar zsh-ab74c86edb30fa04fda5fe7fa01e404334f7c2b0.tar.gz zsh-ab74c86edb30fa04fda5fe7fa01e404334f7c2b0.tar.bz2 zsh-ab74c86edb30fa04fda5fe7fa01e404334f7c2b0.tar.lz zsh-ab74c86edb30fa04fda5fe7fa01e404334f7c2b0.tar.xz zsh-ab74c86edb30fa04fda5fe7fa01e404334f7c2b0.tar.zst zsh-ab74c86edb30fa04fda5fe7fa01e404334f7c2b0.zip | |
37999: Sticky behaviour of EXIT traps.
They now have POSIX or non-POSIX behaviour based on the setting
of POSIX_TRAPS where the trap was defined, rather than where the
trap would (or would not) be executed.
Tweaks possible.
Diffstat (limited to 'Test')
| -rw-r--r-- | Test/C03traps.ztst | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst index 4b2843a47..d8183a428 100644 --- a/Test/C03traps.ztst +++ b/Test/C03traps.ztst @@ -399,6 +399,26 @@ >} >No, really exited + (cd ..; $ZTST_exe -fc 'unsetopt posixtraps; + echo start program + emulate sh -c '\''testfn() { + echo start function + set -o | grep posixtraps + trap "echo EXIT TRAP TRIGGERED" EXIT + echo end function + }'\'' + testfn + echo program continuing + echo end of program') +0:POSIX_TRAPS effect on EXIT trap is sticky +>start program +>start function +>noposixtraps off +>end function +>program continuing +>end of program +>EXIT TRAP TRIGGERED + (set -e printf "a\nb\n" | while read line do |
