summaryrefslogtreecommitdiff
path: root/Test/C03traps.ztst
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2020-02-02 18:05:47 +0000
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2020-02-02 18:05:47 +0000
commite01223a26cb7afd9f44805f067c4dcdad06039b0 (patch)
tree55aa836496b6d616fad10e2bfa1015367799de84 /Test/C03traps.ztst
parent7a9467e430eb331d28065a21c6427714634eeaa5 (diff)
downloadzsh-e01223a26cb7afd9f44805f067c4dcdad06039b0.tar.gz
zsh-e01223a26cb7afd9f44805f067c4dcdad06039b0.zip
45373: Fix ERR_EXIT bug in else branch of if.
The flags need resetting for this branch otherwise e.g. command substitution with non-zero status doesn't cause exit.
Diffstat (limited to 'Test/C03traps.ztst')
-rw-r--r--Test/C03traps.ztst9
1 files changed, 9 insertions, 0 deletions
diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst
index e661aabd5..6f84e5db2 100644
--- a/Test/C03traps.ztst
+++ b/Test/C03traps.ztst
@@ -500,6 +500,15 @@
>Succeed 2
>Succeed 3
+ (set -e
+ if false; then
+ else
+ a=$(false)
+ print This should not appear
+ fi
+ )
+1:ERREXIT is triggered in an else block after a cmd subst returning false
+
fn() {
emulate -L zsh
setopt errreturn