zsh-workers
 help / color / mirror / code / Atom feed
* "set -e" handling is broken with zsh 5.3.1 and 5.4.1
@ 2017-08-27  0:50 Vincent Lefevre
  2017-08-27  1:30 ` Daniel Shahaf
  2017-08-27 18:56 ` Peter Stephenson
  0 siblings, 2 replies; 8+ messages in thread
From: Vincent Lefevre @ 2017-08-27  0:50 UTC (permalink / raw)
  To: zsh-workers

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@vinc17.net> - 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)


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-08-28 20:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-27  0:50 "set -e" handling is broken with zsh 5.3.1 and 5.4.1 Vincent Lefevre
2017-08-27  1:30 ` Daniel Shahaf
2017-08-27  1:46   ` Vincent Lefevre
2017-08-27 18:56 ` Peter Stephenson
2017-08-27 22:26   ` Vincent Lefevre
2017-08-28  1:25     ` Daniel Shahaf
2017-08-28  6:45       ` Bart Schaefer
2017-08-28 20:56         ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).