Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: fixing ${1+"$@"} when word-splitting
- X-seq: zsh-workers 22269
- From: Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- Subject: Re: PATCH: fixing ${1+"$@"} when word-splitting
- Date: Wed, 15 Feb 2006 02:31:41 -0800
- In-reply-to: <20060214071441.GA9931@xxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20060211181440.GA30984@xxxxxxxxxxxxx> <200602122026.k1CKQHGH003629@xxxxxxxxxxxxxxxxx> <20060213105349.GD31780@xxxxxxxxxxxxx> <20060214071441.GA9931@xxxxxxxxxxxxx>
One other minor fix that I noticed in my patched code affects a request
for no-splitting when SH_WORD_SPLIT is enabled:
setopt shwordsplit
foo='1 2'
print -l ${==foo+$foo}
That used to split the variable $foo if it was not quoted (an
interesting case where quotes made a difference in the old code).
I've checked in my changes, including a couple new sentences in the
zshexpn man page.
If we decide that the change in splitting is undesirable after all, the
following one-line change will put things back to the way they were
before (except that the bug above will still be fixed):
--- Src/subst.c 2006-02-15 01:58:31 -0800
+++ Src/subst.c 2006-02-15 02:03:41 -0800
@@ -2065,7 +2065,7 @@
multsub(&val, spbreak && !aspar, (aspar ? NULL : &aval), &isarr, NULL);
opts[SHWORDSPLIT] = ws;
copied = 1;
- spbreak = 0;
+ /*spbreak = 0;*/
}
break;
case ':':
Of course, we'd also need to change some of the D04 tests and the docs.
..wayne..
Messages sorted by:
Reverse Date,
Date,
Thread,
Author