Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: fixing ${1+"$@"} when word-splitting
- X-seq: zsh-workers 22262
- From: Peter Stephenson <pws@xxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- Subject: Re: PATCH: fixing ${1+"$@"} when word-splitting
- Date: Mon, 13 Feb 2006 18:08:57 +0000
- In-reply-to: <20060213174338.GC6952@xxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20060211181440.GA30984@xxxxxxxxxxxxx> <200602122026.k1CKQHGH003629@xxxxxxxxxxxxxxxxx> <20060213105349.GD31780@xxxxxxxxxxxxx> <EXCHANGE03NXLbrBmWU0000c118@xxxxxxxxxxxxxxxxxx> <20060213174338.GC6952@xxxxxxxxxxxxx>
Wayne Davison wrote:
> On Mon, Feb 13, 2006 at 11:34:38AM +0000, Peter Stephenson wrote:
> > local IFS=.-
> > print -l ${=1:-1.2}
> [...]
> > but now gives
> > 1.2
>
> This is due to the multi_isarr weirdness: when it is 0, multsub()
> returns the resulting array joined with $IFS[0], which is what was
> occurring here. I added this line to fix the problem:
OK, thanks, that example now works, but unfortunately the saga
continues... this still fails:
% fn() { local IFS=.-; print -l ${=1:-$ZSH_VERSION}; }
% fn
4.3.0-dev-3
which should also be split since $ZSH_VERSION isn't quoted. (This one's
from is-at-least, too: it seems running "is-at-least 4.0" is a good test
of word splitting.) I presume this is due to the truly horrible
argument passing back from the lower levels.
--
Peter Stephenson <pws@xxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author