From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20141 invoked from network); 12 Feb 2006 20:26:34 -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; 12 Feb 2006 20:26:34 -0000 Received: (qmail 59127 invoked from network); 12 Feb 2006 20:26:28 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 12 Feb 2006 20:26:28 -0000 Received: (qmail 5432 invoked by alias); 12 Feb 2006 20:26:25 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22245 Received: (qmail 5421 invoked from network); 12 Feb 2006 20:26:25 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 12 Feb 2006 20:26:25 -0000 Received: (qmail 58870 invoked from network); 12 Feb 2006 20:26:25 -0000 Received: from mta07-winn.ispmail.ntl.com (81.103.221.47) by a.mx.sunsite.dk with SMTP; 12 Feb 2006 20:26:24 -0000 Received: from aamta09-winn.ispmail.ntl.com ([81.103.221.35]) by mta07-winn.ispmail.ntl.com with ESMTP id <20060212202623.BOHD8780.mta07-winn.ispmail.ntl.com@aamta09-winn.ispmail.ntl.com> for ; Sun, 12 Feb 2006 20:26:23 +0000 Received: from pwslaptop.csr.com ([81.105.238.64]) by aamta09-winn.ispmail.ntl.com with ESMTP id <20060212202623.SEWB1154.aamta09-winn.ispmail.ntl.com@pwslaptop.csr.com> for ; Sun, 12 Feb 2006 20:26:23 +0000 Received: from pwslaptop.csr.com (pwslaptop.csr.com [127.0.0.1]) by pwslaptop.csr.com (8.13.4/8.13.4) with ESMTP id k1CKQINA003632 for ; Sun, 12 Feb 2006 20:26:18 GMT Received: from pwslaptop.csr.com (pws@localhost) by pwslaptop.csr.com (8.13.4/8.13.4/Submit) with ESMTP id k1CKQHGH003629 for ; Sun, 12 Feb 2006 20:26:18 GMT Message-Id: <200602122026.k1CKQHGH003629@pwslaptop.csr.com> X-Authentication-Warning: pwslaptop.csr.com: pws owned process doing -bs From: Peter Stephenson To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: [SOLVED] Libtool/zsh quoting problem: a zsh... bug? In-Reply-To: Your message of "Sat, 11 Feb 2006 10:14:40 PST." <20060211181440.GA30984@dot.blorf.net> Date: Sun, 12 Feb 2006 20:26:17 +0000 Wayne Davison wrote: > I just took a look at that code using Peter's old patch as a start, and > the assertion that the quotes have been stripped out is not quite true: > there are still Dnull and Snull characters remaining which indicate that > there used to be a double- or single-quotes present. This allows us to > check the string. An overly simple version is this: > > --- subst.c 6 Feb 2006 11:57:06 -0000 1.44 > +++ subst.c 11 Feb 2006 18:07:23 -0000 > @@ -2012,6 +2012,8 @@ paramsubst(LinkList l, LinkNode n, char > */ > multsub(&val, (aspar ? NULL : &aval), &isarr, NULL); > copied = 1; > + if (spbreak && (*s == Dnull || *s == Snull)) > + spbreak = 0; > } > break; > case ':': > > This will turn off word-splitting if the string started with a single or > a double quote. This is incomplete because the arg may be something > more complicated (such as: 'one' 'two' 'three four'), but it seems > better than what we have now. Frankly, it's such a mess at the moment that I think any practical improvement is a good thing. However, I think a comment would be a good idea. (I've already covered paramsubst() with ranty comments about the mess but never worked out what to do about it.) > One question I have is what to do about ${=1:"$@"}? In the patch above, > I chose to let the double quotes override the '='. If that is not > desired, change the new "if" to only trigger disallow an spbreak of 2: > > + if (spbreak == 1 && (*s == Dnull || *s == Snull)) As pointed out elsewhere, the ${1+"$@"} is to work around limitations of old Bourne shells and this sort of thing isn't that natural in native zsh, which is the only place we have to worry about the = syntax. I would probably expect the splitting to take place, but I'm not that fussed. -- Peter Stephenson Web page still at http://www.pwstephenson.fsnet.co.uk/