From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4560 invoked from network); 25 Sep 2001 17:07:57 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 25 Sep 2001 17:07:57 -0000 Received: (qmail 2812 invoked by alias); 25 Sep 2001 17:07:49 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15872 Received: (qmail 2787 invoked from network); 25 Sep 2001 17:07:44 -0000 From: Bart Schaefer Message-Id: <1010925170730.ZM11556@candle.brasslantern.com> Date: Tue, 25 Sep 2001 17:07:29 +0000 In-Reply-To: <1010925163945.ZM5789@candle.brasslantern.com> Comments: In reply to Bart Schaefer "PATCH: Re: Minor expansion problem" (Sep 25, 4:39pm) References: <8328.1001434108@csr.com> <1010925163945.ZM5789@candle.brasslantern.com> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: PATCH: Re: Minor expansion problem MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 25, 4:39pm, 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 $(...). } } This seems to fix it No, on second look, I mistyped my test case; it doesn't fix it after all. Seems subst_parse_str() needs to turn Qtick into Tick as well as Qstring into String. The following goes on top of 15871. Now I'm concerned enough about this to wait for some feedback before I commit it. All tests pass (including the new one below), but better safe than sorry. 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 17:00:08 @@ -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; @@ -724,9 +724,12 @@ int qt = 0; for (; *s; s++) - if (!qt && *s == Qstring) - *s = String; - else if (*s == Dnull) + if (!qt) { + if (*s == Qstring) + *s = String; + else if (*s == Qtick) + *s = Tick; + } else if (*s == Dnull) qt = !qt; } return 0; Index: Test/D04parameter.ztst =================================================================== diff -c -r1.4 D04parameter.ztst --- Test/D04parameter.ztst 2001/09/05 15:22:35 1.4 +++ Test/D04parameter.ztst 2001/09/25 16:52:53 @@ -212,10 +212,17 @@ >split me >I'm yours - foo='$(print Howzat)' - print ${(e)foo} + foo='$(print Howzat usay)' + print -l ${(e)foo} 0:${(e)...} >Howzat +>usay + + foo='`print Howzat usay`' + print -l ${(e)foo} +0:Regress ${(e)...} with backticks (see zsh-workers/15871) +>Howzat +>usay foo='I'\''m nearly out of my mind with tedium' bar=foo -- 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