Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: fixing ${1+"$@"} when word-splitting
- X-seq: zsh-workers 22257
- 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 11:34:38 +0000
- In-reply-to: <20060213105349.GD31780@xxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20060211181440.GA30984@xxxxxxxxxxxxx> <200602122026.k1CKQHGH003629@xxxxxxxxxxxxxxxxx> <20060213105349.GD31780@xxxxxxxxxxxxx>
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 <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