From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4354 invoked from network); 25 Sep 2001 16:40:12 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 25 Sep 2001 16:40:12 -0000 Received: (qmail 25825 invoked by alias); 25 Sep 2001 16:40:02 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15871 Received: (qmail 25798 invoked from network); 25 Sep 2001 16:39:59 -0000 From: Bart Schaefer Message-Id: <1010925163945.ZM5789@candle.brasslantern.com> Date: Tue, 25 Sep 2001 16:39:45 +0000 In-Reply-To: <8328.1001434108@csr.com> Comments: In reply to Peter Stephenson "Re: Minor expansion problem" (Sep 25, 5:08pm) References: <8328.1001434108@csr.com> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: PATCH: Re: Minor expansion problem MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 25, 5:08pm, Peter Stephenson wrote: } } Bart Schaefer wrote: } > Expanding $(...) doesn't put } > in backslashes, but expanding `...` does. This appears to be happening } > because the ${(e)exp} at _expand line 83 returns one word for `...` but } > an array for $(...). } } Yes, it's completely reproducible just with ${(e)exp}. This seems to fix it (and a typo in a comment). I'm a bit dubious of changing mult_isarr possibly in the middle of a word, but that's what happens in the $(...) case at line 111, so ... Index: Src/subst.c =================================================================== diff -c -r1.6 subst.c --- Src/subst.c 2001/09/05 15:22:33 1.6 +++ Src/subst.c 2001/09/25 16:33:20 @@ -133,7 +133,7 @@ str3 = (char *)getdata(node); continue; } - } else if ((qt = c == Qtick) || c == Tick) + } else if ((qt = c == Qtick) || (c == Tick ? mult_isarr = 1 : 0)) comsub: { LinkList pl; char *s, *str2 = str; @@ -1492,7 +1492,7 @@ /* This once was executed only `if (qt) ...'. But with that * patterns in a expansion resulting from a ${(e)...} aren't * tokenized even though this function thinks they are (it thinks - * they are because subst_parse_string() turns Qstring tokens + * they are because subst_parse_str() turns Qstring tokens * into String tokens and for unquoted parameter expansions the * lexer normally does tokenize patterns inside parameter * expansions). */ -- 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