Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] NEWS item about the ERR_EXIT fixes



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.

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

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


Messages sorted by: Reverse Date, Date, Thread, Author