From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17994 invoked by alias); 27 Dec 2014 02:35:39 -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: 34059 Received: (qmail 22046 invoked from network); 27 Dec 2014 02:35:36 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=CoYIqc8G c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=A92cGCtB03wA:10 a=ZGmkikg7ztV0hkpAIYQA:9 a=CjuIK1q_8ugA:10 From: Bart Schaefer Message-id: <141226183516.ZM18384@torch.brasslantern.com> Date: Fri, 26 Dec 2014 18:35:16 -0800 In-reply-to: <20141226165344.GC1003@basilisk> Comments: In reply to mvxxc@gmx.de "Bug report" (Dec 26, 5:53pm) References: <20141226165344.GC1003@basilisk> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: mvxxc@gmx.de, zsh-workers@zsh.org Subject: Re: Bug report MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Dec 26, 5:53pm, mvxxc@gmx.de wrote: } Subject: Bug report } } If the following script is run in an empty directory, zsh executes the } defined function only once. Changing this line: } set -e To "set -exv" shows that func is in fact called twice but exits without doing anything on the second call. I therefore suspect one of workers/32568 or workers/32569. This is very tricky because we have to propagate the value of $? from before the "for" keyword (including before the start of the function) into the "do" body, but must *not* *use* the value of $? for deciding whether to exit-on-error, because the nonzero value came from an "if" test. There is a "noerrexit" flag that is supposed to cover this case, but it's not set when the very first "sublist" in a function body is a for-loop (there are likely to be other similar cases).