From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1791 invoked from network); 9 Apr 2002 11:30:50 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 9 Apr 2002 11:30:50 -0000 Received: (qmail 15831 invoked by alias); 9 Apr 2002 11:30:44 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16949 Received: (qmail 15810 invoked from network); 9 Apr 2002 11:30:42 -0000 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: Zsh 3 and ${1+"$@"} (Was: [GNU Autoconf 2.53] testsuite.log: 126 failures) In-reply-to: "Peter Stephenson"'s message of "Tue, 09 Apr 2002 11:35:43 BST." <28727.1018348543@csr.com> Date: Tue, 09 Apr 2002 12:30:12 +0100 Message-ID: <25364.1018351812@csr.com> From: Peter Stephenson Peter Stephenson wrote: > I think the problem you are running across is that with the option > SH_WORD_SPLIT set (as it is for sh compatibility), you get this behaviour: > > % set 'one two' > % for arg in ${1+"$@"}; do echo $arg; done > one > two > > whereas you expect `one two' on the same line. This problem is still in > zsh 4 --- inside another substitution, either it's splitting all words > on spaces, or it's splitting none. (For zsh-workers only.) By the way, I'm sure this is horribly incomplete at best --- and paramsubst() is too grotesque for me to understand it --- but, just so I understand what is going on, what is the problem with (deliberately expanded the context): Index: Src/subst.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/subst.c,v retrieving revision 1.30 diff --unified=10 -r1.30 subst.c --- Src/subst.c 22 Feb 2002 17:28:06 -0000 1.30 +++ Src/subst.c 9 Apr 2002 11:27:09 -0000 @@ -1478,20 +1478,22 @@ val = dupstring(s); /* * This is not good enough for sh emulation! Sh would * split unquoted substrings, yet not split quoted ones * (except according to $@ rules); but this leaves the * unquoted substrings unsplit, and other code below * for spbreak splits even within the quoted substrings. */ multsub(&val, (aspar ? NULL : &aval), &isarr, NULL); copied = 1; + if (spbreak == 1) + spbreak = 0; } break; case ':': if (*s != '=' && *s != Equals) goto noclosebrace; vunset = 1; s++; /* Fall through */ case '=': case Equals: -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 392070 ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************