From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11711 invoked by alias); 9 Jul 2015 11:33:17 -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: 35747 Received: (qmail 7558 invoked from network); 9 Jul 2015 11:33:16 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=iGkvSiDarNg8fjTdctanT1thJom1oKiG+OIoYTXFCzs=; b=Ofyxp/ifPcKW7QOodKzERcnvrV8/I96VH18tWrzJda/ixMApIiye1DnWEweM9FrIQn mErJUl6nOQYLE1FC4OFYNhVp+McGXMmiunhhre6jEgpnULSiVRxLYTQFgk5R3DXG80QR uZVt19Imu3naFQHjfrDU2rB3F2CHOm7Sqz9hDvaQB0wuIcpnyC0Ngt7IQW6g+ZEqW0jD AzxFS/ePnM6GjXuhG+up/ydfPsO32oKh8vT3xbRGILX2SzzNMdzMGmItiYvSwbssSX+Q 4UdbVudJS4uBOS1jScki/0FChgGQyitcO5ajcFhjAvMUS6rsysMNZY/8XfbRF0Rqdeqm 4kxQ== MIME-Version: 1.0 X-Received: by 10.50.134.226 with SMTP id pn2mr67850073igb.21.1436441589543; Thu, 09 Jul 2015 04:33:09 -0700 (PDT) Date: Thu, 9 Jul 2015 13:33:09 +0200 Message-ID: Subject: err_exit/err_return regression From: jsks To: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 Since patch 34065, with either err_exit or err_return set, zsh does not exit/return given a nonzero exist status of a command following 'else'. Example: $ setopt err_return; if false; then :; else false; echo foo; fi foo However, command lists following 'if' and 'elif' work as expected. $ setopt err_return; if true; then false; echo foo; else :; fi In the execif function of loop.c, when executing the command list of an else statement, given that lastval from the evaluation of the previous if/elif is nonzero, the flag noerrexit is never reset to its original value. noerrexit = olderrexit ? olderrexit : lastval ? 2 : 0; Unless I misunderstood the intended behaviour, didn't know how to handle this with regards to the patch fixing for example return values and for loops, so simply reporting. /jsks