Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: fixing ${1+"$@"} when word-splitting



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