From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23969 invoked by alias); 6 Oct 2016 08:36:24 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39578 Received: (qmail 13484 invoked from network); 6 Oct 2016 08:36:24 -0000 X-Qmail-Scanner-Diagnostics: from mailout4.w1.samsung.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(210.118.77.14):SA:0(-2.6/5.0):. Processed in 0.479229 secs); 06 Oct 2016 08:36:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=RP_MATCHES_RCVD autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: p.stephenson@samsung.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at samsung.com does not designate permitted sender hosts) X-AuditID: cbfec7f5-f79ce6d000004c54-09-57f60cff43ee Date: Thu, 06 Oct 2016 09:36:11 +0100 From: Peter Stephenson To: Zsh hackers list Subject: Re: 'set -e' with '!' POSIX issue Message-id: <20161006093611.4cef772f@pwslap01u.europe.root.pri> In-reply-to: <20161005144703.12fdf6c4@pwslap01u.europe.root.pri> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrNIsWRmVeSWpSXmKPExsWy7djPc7r/eb6FG6ztNLE42PyQyYHRY9XB D0wBjFFcNimpOZllqUX6dglcGVd2vmIvmM5TcXZOP3sD43TOLkZODgkBE4npz2YwQdhiEhfu rWfrYuTiEBJY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zVeYQWxOAQeJ9xe7mCCGdjBLTNpwghUkwS+gL3H1 7ycmiPvsJWZeOcMI0Swo8WPyPbBBzEBDN29rYoWw5SU2r3nLDPGDusSNu7vZJzAKz0LSMgtJ yywkLQsYmVcxiqSWFuem5xYb6RUn5haX5qXrJefnbmIExtG2Yz+37GDsehd8iFGAg1GJh9dA 42u4EGtiWXFl7iFGCQ5mJRFeSWAUCvGmJFZWpRblxxeV5qQWH2I0BYbMRGYp0eR8YIznlcQb mhiaWxoaGVtYmBsZKYnzTv1wJVxIID2xJDU7NbUgtQimj4mDU6qB8XKn/uGnKhpNjYoKOe/b qxeW5FxVc3HefMXvuMO95emfDv7e+/guowefNd+F3UadJ77FvrpiLO796Wq7QYup/1rTd7yf vLZ+da6eN+/rTs5HVn9ePhBLrfl2qWOTE8/6xKkmPX9fufM764W8i/5s/fJenMd7nnw/e8kv ubotzcENGvlV8smnlFiKMxINtZiLihMBk27BFbkCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161006083615eucas1p16fdd99c07aa64d6b50976cbabe843f21 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?UGV0ZXIgU3RlcGhlbnNvbhtTQ1NDLURhdGEgUGxhbmUb?= =?UTF-8?B?7IK87ISx7KCE7J6QG1ByaW5jaXBhbCBFbmdpbmVlciwgU29mdHdhcmU=?= X-Global-Sender: =?UTF-8?B?UGV0ZXIgU3RlcGhlbnNvbhtTQ1NDLURhdGEgUGxhbmUbU2Ft?= =?UTF-8?B?c3VuZyBFbGVjdHJvbmljcxtQcmluY2lwYWwgRW5naW5lZXIsIFNvZnR3YXJl?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDA1Q0QwNTAwNTg=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20161004075413eucas1p2cf7a0e3dded0a894b79c661f6da0b885 X-RootMTR: 20161004075413eucas1p2cf7a0e3dded0a894b79c661f6da0b885 References: <70cf25f2-f156-51c4-60b6-00def8769328@inlv.org> <20161002185530.3fa8c013@ntlworld.com> <20161004074538.GD4212@cventin.lip.ens-lyon.fr> <20161004093005.7dbc6696@pwslap01u.europe.root.pri> <4e660f18-3850-d589-8a17-e75d2c419fbe@inlv.org> <20161005144703.12fdf6c4@pwslap01u.europe.root.pri> On Wed, 5 Oct 2016 14:47:03 +0100 Peter Stephenson wrote: > Please reassure me that this is correct: > > % ./zsh -fc 'set -e; foo() { false && false; echo OK; }; foo; echo $?' > OK > 0 > > We hit the first "false" in the &&, which doesn't trigger ERR_EXIT so > the second "false" that would is never executed; therefore we proceed to > "echo OK"; therefore the status of the function is 0. If there's no > controversy I may add this as a test case for future reference, together > with the "true & false" case that causes the function to be aborted. Here are corresponding tests. Nothing fundamentally new compared with previous tests, it's just a bit more complicated. pws diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst index 5057dcf..74b83f3 100644 --- a/Test/C03traps.ztst +++ b/Test/C03traps.ztst @@ -596,6 +596,36 @@ F:Must be tested with a top-level script rather than source or function >before-out >before-in + (setopt err_return + fn() { + print before-in + false && false + print after-in + } + print before-out + fn + print after-out + ) +0:ERR_RETURN not triggered on LHS of "&&" in function +>before-out +>before-in +>after-in +>after-out + + (setopt err_return + fn() { + print before-in + true && false + print after-in + } + print before-out + fn + print after-out + ) +1:ERR_RETURN triggered on RHS of "&&" in function +>before-out +>before-in + %clean rm -f TRAPEXIT