From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13356 invoked from network); 16 Feb 2001 17:05:51 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 16 Feb 2001 17:05:51 -0000 Received: (qmail 23596 invoked by alias); 16 Feb 2001 17:05:45 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13495 Received: (qmail 23584 invoked from network); 16 Feb 2001 17:05:44 -0000 From: "Bart Schaefer" Message-Id: <1010216170344.ZM19462@candle.brasslantern.com> Date: Fri, 16 Feb 2001 17:03:44 +0000 In-Reply-To: <001601c097f5$90e19b20$21c9ca95@mow.siemens.ru> Comments: In reply to "Andrej Borsenkow" "RE: PATCH: Re: More incompatibility (word splitting)" (Feb 16, 11:50am) References: <001601c097f5$90e19b20$21c9ca95@mow.siemens.ru> X-Mailer: Z-Mail (5.0.0 30July97) To: "Zsh hackers list" Subject: Re: PATCH: Re: More incompatibility (word splitting) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Feb 16, 11:50am, Andrej Borsenkow wrote: } Subject: RE: PATCH: Re: More incompatibility (word splitting) } } > Here's the patch as I'm willing to commit it right now. } } Does it really fix two described incompatibilities? O It fixes the incompatibility with 3.0.8, i.e. ${1+"$@"} does the right thing when *not* emulating sh, which it didn't before. It fixes "${(A)foo=$bar[@]}" but not [ ${foo=""} = "true" ]. Although actually, sigh, it breaks "${(A)=foo=$bar}" in that it splits $bar and assigns the array to $foo but then doesn't split $foo when it substitutes the end result. --- zsh-forge/current/Src/subst.c Fri Feb 16 00:35:19 2001 +++ zsh-3.1.9/Src/subst.c Fri Feb 16 08:18:49 2001 @@ -1015,7 +1015,7 @@ spbreak = 0; s++; } else - spbreak = 1; + spbreak = 2; } else if ((c == '#' || c == Pound) && (iident(cc = s[1]) || cc == '*' || cc == Star || cc == '@' @@ -1414,8 +1414,6 @@ if (spsep || spbreak) { aval = sepsplit(val, spsep, 0, 1); isarr = 2; - sep = spsep = NULL; - spbreak = 0; l = arrlen(aval); if (l && !*(aval[l-1])) l--; @@ -1456,10 +1454,12 @@ if (isarr) { if (nojoin) isarr = -1; - if (qt && !getlen && isarr > 0) { + if (qt && !getlen && isarr > 0 && !spsep && spbreak < 2) { val = sepjoin(aval, sep, 1); isarr = 0; } + sep = spsep = NULL; + spbreak = 0; } } break; -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net