From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27213 invoked from network); 13 Feb 2006 11:35:00 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 13 Feb 2006 11:35:00 -0000 Received: (qmail 54971 invoked from network); 13 Feb 2006 11:34:54 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 13 Feb 2006 11:34:54 -0000 Received: (qmail 11684 invoked by alias); 13 Feb 2006 11:34:52 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22257 Received: (qmail 11673 invoked from network); 13 Feb 2006 11:34:51 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 13 Feb 2006 11:34:51 -0000 Received: (qmail 54681 invoked from network); 13 Feb 2006 11:34:51 -0000 Received: from cluster-c.mailcontrol.com (168.143.177.190) by a.mx.sunsite.dk with SMTP; 13 Feb 2006 11:34:50 -0000 Received: from exchange03.csr.com (uuk202166.uk.customer.alter.net [62.189.241.194] (may be forged)) by rly27c.srv.mailcontrol.com (MailControl) with ESMTP id k1DBYmuo032332 for ; Mon, 13 Feb 2006 11:34:49 GMT Received: from csr.com ([10.103.143.38]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Mon, 13 Feb 2006 11:34:48 +0000 To: Zsh hackers list Subject: Re: PATCH: fixing ${1+"$@"} when word-splitting In-reply-to: <20060213105349.GD31780@dot.blorf.net> References: <20060211181440.GA30984@dot.blorf.net> <200602122026.k1CKQHGH003629@pwslaptop.csr.com> <20060213105349.GD31780@dot.blorf.net> Comments: In-reply-to Wayne Davison message dated "Mon, 13 Feb 2006 02:53:49 -0800." Date: Mon, 13 Feb 2006 11:34:38 +0000 From: Peter Stephenson Message-ID: X-OriginalArrivalTime: 13 Feb 2006 11:34:48.0278 (UTC) FILETIME=[7ED2E760:01C63091] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-06-00-02 (www.mailcontrol.com) on 10.67.0.137 Wayne Davison wrote: > --LyciRD1jyfeSSjG0 > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > > On Sun, Feb 12, 2006 at 08:26:17PM +0000, Peter Stephenson wrote: > > Frankly, it's such a mess at the moment that I think any practical > > improvement is a good thing. > > OK. Here's something even better. This appears to make us totally > compatible with bash. This looks extremelly promising (particularly since it still passes all the tests as modified) but there is one glitch which turned up from the function is-at-least, which is called liberally from my .zshrc. It traces down to: fn() { local IFS=.- print -l ${=1:-1.2} } With no arguments, this used to give 1 2 but now gives 1.2 With 1.2 passed as an argument instead it always gives the first behaviour. I suspect this is the wrong behaviour since bash gives me: $ fn() { local IFS=.-; echo ${1:-1.2}; } $ fn 1 2 which suggests the argument should be split (as it's unquoted). (Naively, I would also expect an unquoted 1.2 to be split in the same way whether it came from the positional parameter or the default.) Anyway, I expect that's yet another complexity. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php