Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
"set -e" handling is broken with zsh 5.3.1 and 5.4.1
- X-seq: zsh-workers 41605
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: "set -e" handling is broken with zsh 5.3.1 and 5.4.1
- Date: Sun, 27 Aug 2017 02:50:40 +0200
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Consider:
----------------------------------------
#!/usr/bin/env zsh
set -e
f()
{
[[ -z 1 ]] && false
}
if false; then
:
else
f
echo Fail 1
echo Fail 2
f
echo Fail 3
fi
----------------------------------------
With
zsh 5.3.1-4+b1 under Debian/stretch
zsh 5.4.1-1 under Debian/unstable
I get:
% ./cond2-e; echo $?
Fail 1
Fail 2
1
I suppose that cond2-e should die just after f is called, before
outputting anything. At least, the behavior is not consistent.
zsh 5.0.7 was outputting:
Fail 1
Fail 2
Fail 3
but I suppose that this was incorrect (different from what other
shells give on similar POSIX code).
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author