From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6884 invoked by alias); 12 Mar 2014 17:13:31 -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: 32476 Received: (qmail 9419 invoked from network); 12 Mar 2014 17:13:16 -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=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 X-AuditID: cbfec7f5-b7fc96d000004885-ee-5320934d1ab6 Date: Wed, 12 Mar 2014 17:03:09 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Cc: "Eduardo A. Bustamante Lopez" Subject: Re: Zsh does not follow POSIX when return is called during the action of a trap Message-id: <20140312170309.48ea7444@pwslap01u.europe.root.pri> In-reply-to: <140312095210.ZM13090@torch.brasslantern.com> References: <20140312153627.GA15209@dualbus.me> <140312095210.ZM13090@torch.brasslantern.com> 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+NgFlrILMWRmVeSWpSXmKPExsVy+t/xa7q+kxWCDb78lbU4fuYMu8XB5odM DkweO2fdZfdYdfADUwBTFJdNSmpOZllqkb5dAlfGlQ9GBYc4Km51tjI3MF5i62Lk5JAQMJF4 vfAAM4QtJnHh3nqgOBeHkMBSRomze7exQzj9TBKHpj1gB6liEVCV+LRzChOIzSZgKDF102xG EFtEQFzi7NrzLCA2s4CpxO5pTUD1HBzCAlESs36Hg4R5BewlXi7YClbOKWAlseTtWrAjhATi JWY+XgHWyi+gL3H17ycmiIPsJWZeOcMI0Sso8WPyPajxWhKbtzWxQtjyEpvXvGWewCg4C0nZ LCRls5CULWBkXsUomlqaXFCclJ5rpFecmFtcmpeul5yfu4kREqxfdzAuPWZ1iFGAg1GJh3em knywEGtiWXFl7iFGCQ5mJRHeXd0KwUK8KYmVValF+fFFpTmpxYcYmTg4pRoYHfMOadin5J0+ pXBW/JLo3ywWx/28QW0f/vyPzOdarZdQnWL687K51NNbqoIrrXZOdFs7xz425G9b/u/w5so9 mV9vX3nJLbYvsFRGY6PubPWIhMtrtdbFL+j7y1hwa+vCDS/t1/No3OndwtHzabPjH48oxg3H 3wtFrli6ZEPbz8nvaxhfftgtrcRSnJFoqMVcVJwIAKddnCk0AgAA On Wed, 12 Mar 2014 09:52:10 -0700 Bart Schaefer wrote: > On Mar 12, 8:36am, Eduardo A. Bustamante Lopez wrote: > } > } Hi! I first reported this bug to bug-bash, but since it also applies > } to zsh, I wanted you to know about it. > > Have you tried this with the POSIX_TRAPS option set? > > Zsh does not in general conform to POSIX at all unless you run it with > the appropriate compatibility settings. I was going to mention that. I think it still needs some work --- which I know how to do in this case. N.B. you can test this with the line [ x$ZSH_VERSION != x ] && emulate sh at the top of the "code" variable. However, I'm trying to work out what happens with the case | trap '(exit BEFORE-RETURN); return EXPLICIT-RETURN-VALUE' SIGNAL | | fn() { | (exit BEFORE-ACTION); -block here waiting for signal- | } Should this exit with EXPLICIT-RETURN_VALUE or BEFORE-ACTION? The latter is easier to implement but my guess (without ploughing through the standard) is EXPLICIT-RETURN-VALUE is right here. pws