zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] NEWS item about the ERR_EXIT fixes
@ 2022-12-08 21:45 Philippe Altherr
  2022-12-09  0:24 ` Bart Schaefer
  0 siblings, 1 reply; 13+ messages in thread
From: Philippe Altherr @ 2022-12-08 21:45 UTC (permalink / raw)
  To: Zsh hackers list


[-- 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
 -------------------
 

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

end of thread, other threads:[~2022-12-13  3:06 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-08 21:45 [PATCH] NEWS item about the ERR_EXIT fixes Philippe Altherr
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

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).