zsh-workers
 help / color / mirror / code / Atom feed
From: Philippe Altherr <philippe.altherr@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: [PATCH] NEWS item about the ERR_EXIT fixes
Date: Thu, 8 Dec 2022 22:45:32 +0100	[thread overview]
Message-ID: <CAGdYchux2TcXzp0jUZZfpGMZZT8oe9zB-YkgAs8JepxpaedESw@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 588 bytes --]

Here is the promised NEWS item that documents the ERR_EXIT fixes.
Unfortunately, explaining what changes isn't that easy because only rather
involved cases are affected. I couldn't make it shorter than what is in the
patch. And I still omitted the even more involved case fixed by 51071: fix
ERR_RETURN for functions in conditional statements
<https://github.com/zsh-users/zsh/commit/259f1e944b96715fda25f7ba227da05bdb7e600f>
.

An alternative would be to simply state that a number of ERR_EXIT bugs
affecting only corner cases were fixed, without trying to describe the
cases.

Philippe

[-- Attachment #1.2: Type: text/html, Size: 694 bytes --]

[-- Attachment #2: patch-errexit-fixes-news.txt --]
[-- Type: text/plain, Size: 1397 bytes --]

diff --git a/NEWS b/NEWS
index cdafd1ff5..877a5550b 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,26 @@ CHANGES FROM PREVIOUS VERSIONS OF ZSH
 
 Note also the list of incompatibilities in the README file.
 
+Changes since 5.9
+-----------------
+
+Fixed several bugs in the implementation of ERR_EXIT. When ERR_EXIT is
+enabled, when any command fails the shell immediately exits, except if
+ERR_EXIT was being suppressed for that command. ERR_EXIT is suppressed
+for commands on the left of && and ||, on the right of !, and in the
+condition of if, while, and until. ERR_EXIT is also suppressed in any
+structured command (if, for, while, until, repeat, case, select,
+always, or a list in braces) whose exit status is the result of a
+failure while ERR_EXIT was being suppressed. Thus, neither "false &&
+true" nor "if true; then false && true; fi" cause an immediate exit.
+However, if these expressions are the body of a function, then a call
+to that function must cause an exit. Until now, Zsh failed to do so
+for the latter. Similarly, it failed to exit if that expression was
+the argument of an eval command or the body of a sourced script.
+Until now, Zsh also failed to suppress ERR_EXIT for negated function
+calls and for always statements. Thus, "func() { true }; ! func" and
+"{ false && true } always { true }" incorrectly caused an exit.
+
 Changes since 5.8.1
 -------------------
 

             reply	other threads:[~2022-12-08 21:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-08 21:45 Philippe Altherr [this message]
2022-12-09  0:24 ` Bart Schaefer
2022-12-09  6:44   ` Lawrence Velázquez
2022-12-09  9:30     ` Philippe Altherr
2022-12-09 15:17       ` Mikael Magnusson
2022-12-10  7:23         ` Lawrence Velázquez
2022-12-10  7:35       ` Lawrence Velázquez
2022-12-10 11:32     ` Daniel Shahaf
2022-12-10 13:49       ` Philippe Altherr
2022-12-11  3:32         ` Lawrence Velázquez
2022-12-13  0:33           ` Philippe Altherr
2022-12-13  3:05             ` Daniel Shahaf
2022-12-11  3:23       ` Lawrence Velázquez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGdYchux2TcXzp0jUZZfpGMZZT8oe9zB-YkgAs8JepxpaedESw@mail.gmail.com \
    --to=philippe.altherr@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).