From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19953 invoked from network); 29 Jul 1997 06:13:25 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 29 Jul 1997 06:13:25 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.8.5/8.8.5) id CAA13895; Tue, 29 Jul 1997 02:06:48 -0400 (EDT) Resent-Date: Tue, 29 Jul 1997 02:06:48 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199707290604.CAA02191@hzoli.home> Subject: Re: RC_EXPAND_PARAM bug In-Reply-To: <970728092639.ZM12131@candle.brasslantern.com> from Bart Schaefer at "Jul 28, 97 09:26:39 am" To: schaefer@brasslantern.com (Bart Schaefer) Date: Tue, 29 Jul 1997 02:04:31 -0400 (EDT) Cc: zefram@tao.co.uk, zsh-workers@math.gatech.edu X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"ERz0b2.0.2P3.tXOtp"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3380 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Bart Schaefer wrote: > On Jul 28, 2:42pm, Andrew Main wrote: [...] > } % a=(a b) > } % x=(x y) > } % echo ${^a}1${^x} > } a1y b1x b1y > } > } ? > > It gets weirder: > > % echo 1${^a}1${^^x} > 1ay 1b1x 1by Below is a fix. The second expansion might still look a bit weird: % echo 1${^a}1${^^x} 1a1x 1ay 1b1x 1by The logic is that the string after the rc-param, 1${^^x}, is expanded, producing two strings, 1x y, which is combined with 1a 1b. It is true that this is incompatible with 2.6-beta16 and older, which first expanded it to 1a1${^^x} 1b1${^^x} and later this was expanded to 1a1x y 1b1x y. Similarily, let i=0; echo ${^a}$[i++] expanded to a$[i++] b$[i++] and later to a0 b1, while in zsh-3.0.4 it expands to a0 b0. Zoltan *** Src/subst.c 1997/06/17 05:53:19 3.1.3.2 --- Src/subst.c 1997/07/29 05:40:45 *************** *** 1423,1430 **** (char *) getdata(tn), globsubst); if (qt && !*y && isarr != 2) y = dupstring(nulstring); ! if (i == 1) ! setdata(n, (void *) y); else insertlinknode(l, n, (void *) y), incnode(n); } --- 1423,1430 ---- (char *) getdata(tn), globsubst); if (qt && !*y && isarr != 2) y = dupstring(nulstring); ! if (plan9) ! setdata(n, (void *) y), plan9 = 0; else insertlinknode(l, n, (void *) y), incnode(n); }