From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19371 invoked from network); 2 Jul 2009 12:13:42 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,UNPARSEABLE_RELAY autolearn=ham version=3.2.5 Received: from new-brage.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.254.104) by ns1.primenet.com.au with SMTP; 2 Jul 2009 12:13:42 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 52121 invoked from network); 2 Jul 2009 12:05:34 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 2 Jul 2009 12:05:34 -0000 Received: (qmail 26602 invoked by alias); 2 Jul 2009 12:05:22 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27086 Received: (qmail 26586 invoked from network); 2 Jul 2009 12:05:21 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 2 Jul 2009 12:05:21 -0000 Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 8B7878030807 for ; Thu, 2 Jul 2009 14:05:04 +0200 (CEST) Received: from root by ciao.gmane.org with local (Exim 4.43) id 1MML2F-0003ij-0P for zsh-workers@sunsite.dk; Thu, 02 Jul 2009 12:05:03 +0000 Received: from c-24-10-247-15.hsd1.ut.comcast.net ([c-24-10-247-15.hsd1.ut.comcast.net]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 02 Jul 2009 12:05:03 +0000 Received: from ebb9 by c-24-10-247-15.hsd1.ut.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 02 Jul 2009 12:05:03 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-workers@sunsite.dk From: Eric Blake Subject: Re: zsh bug in . builtin Date: Thu, 2 Jul 2009 12:01:11 +0000 (UTC) Message-ID: References: <4A4B614E.7000406@byu.net> <20090701152420.2beb1c78@news01> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 24.10.247.15 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16 Mnenhy/0.7.5.666) Sender: news X-Virus-Scanned: ClamAV 0.94.2/9535/Thu Jul 2 10:57:25 2009 on bifrost X-Virus-Status: Clean Peter Stephenson csr.com> writes: > Those are all bugs; it's not supposed to ignore errors even in native mode. > I've taken 128 to mean failed to execute file, 129 to mean failed to find > file---anyone can suggest better values if unhappy. I'd much prefer 127 for a missing file (similar to exec), and something < 127 for syntax error (128 and above should typically be for signals). Also, you may want to consistently detect syntax errors in eval and in the action to trap: $ zsh -c 'eval "if"; echo $?' 0 $ zsh -c 'emulate sh; eval "if"; echo $?' zsh:1: parse error near `if' 1 $ zsh -c 'trap "if" 0'; echo $? 0 $ zsh -c 'emulate sh; trap "if" 0'; echo $? zsh:1: parse error near `if' zsh:trap:1: couldn't parse trap command 1 $ zsh -c 'trap "if" 1; kill -1 $$; echo $?' 0 $ zsh -c 'emulate sh; trap "if" 1; kill -1 $$; echo $?' zsh:1: parse error near `if' zsh:trap:1: couldn't parse trap command $ echo $? 1