From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11622 invoked from network); 15 Jan 2009 20:29:49 -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=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 15 Jan 2009 20:29:49 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 66719 invoked from network); 15 Jan 2009 20:29:45 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 15 Jan 2009 20:29:45 -0000 Received: (qmail 5582 invoked by alias); 15 Jan 2009 20:29:42 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26318 Received: (qmail 5565 invoked from network); 15 Jan 2009 20:29:41 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 15 Jan 2009 20:29:41 -0000 Received: from mtaout02-winn.ispmail.ntl.com (mtaout02-winn.ispmail.ntl.com [81.103.221.48]) by bifrost.dotsrc.org (Postfix) with ESMTP id A5D5880271F0 for ; Thu, 15 Jan 2009 21:29:38 +0100 (CET) Received: from aamtaout02-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090115202938.YHPB4080.mtaout02-winn.ispmail.ntl.com@aamtaout02-winn.ispmail.ntl.com> for ; Thu, 15 Jan 2009 20:29:38 +0000 Received: from pws-pc.ntlworld.com ([81.107.45.176]) by aamtaout02-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090115202938.IDYG21638.aamtaout02-winn.ispmail.ntl.com@pws-pc.ntlworld.com> for ; Thu, 15 Jan 2009 20:29:38 +0000 Received: from pws-pc (pws-pc [127.0.0.1]) by pws-pc.ntlworld.com (8.14.3/8.14.2) with ESMTP id n0FKTTHD016851 for ; Thu, 15 Jan 2009 20:29:29 GMT Message-Id: <200901152029.n0FKTTHD016851@pws-pc.ntlworld.com> From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: treatment of empty strings - why is this not a bug? In-Reply-To: Message from Greg Klanderman of "Thu, 15 Jan 2009 15:11:08 EST." Date: Thu, 15 Jan 2009 20:29:29 +0000 X-Cloudmark-Analysis: v=1.0 c=1 a=b9lWrR2ZfKoA:10 a=7862LJqnZcQA:10 a=NLZqzBF-AAAA:8 a=wPSQJlXT9cYfFUTX__EA:9 a=BireREeHOY0YxEEUVLHJKAXC78sA:4 a=SKpDKCWXRSQA:10 X-Virus-Scanned: ClamAV 0.92.1/8869/Thu Jan 15 18:37:21 2009 on bifrost X-Virus-Status: Clean Greg Klanderman wrote: > I still do not understand why I get exactly two empty strings no > matter how many colons I have in the input string: I would expect > none based on the description you cited. > > phl% x=::::: && for v in "${(s-:-)x}" ; do echo "v= =>$v<=" ; done > v= =><= > v= =><= > phl% x=: && for v in "${(s-:-)x}" ; do echo "v= =>$v<=" ; done > v= =><= > v= =><= It's to do with the code that joins parameters with what's next to them, which is why the RC_EXPAND_PARAM option is different. Quite why it does what it does I don't understand either, however; but I don't really understand this particular piece of traditional behaviour at all. If I were changing it, rather than try to sanitize it I would simply remove it. -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/