zsh-workers
 help / color / mirror / code / Atom feed
From: Zoltan Hidvegi <hzoli@frontiernet.net>
To: schaefer@brasslantern.com (Bart Schaefer)
Cc: zefram@tao.co.uk, zsh-workers@math.gatech.edu
Subject: Re: RC_EXPAND_PARAM bug
Date: Tue, 29 Jul 1997 02:04:31 -0400 (EDT)	[thread overview]
Message-ID: <199707290604.CAA02191@hzoli.home> (raw)
In-Reply-To: <970728092639.ZM12131@candle.brasslantern.com> from Bart Schaefer at "Jul 28, 97 09:26:39 am"

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);
  		}


  reply	other threads:[~1997-07-29  6:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-07-28 13:42 Andrew Main
1997-07-28 16:26 ` Bart Schaefer
1997-07-29  6:04   ` Zoltan Hidvegi [this message]
1997-07-29  7:09     ` Bart Schaefer
1997-07-29  7:36       ` Zoltan Hidvegi
1997-07-29  7:47     ` Geoff Wing
1997-07-29 16:27       ` Bart Schaefer
1997-07-30  3:04         ` Geoff Wing
1997-07-30  3:56           ` Bart Schaefer
1997-07-30  5:16         ` Zoltan Hidvegi
1997-07-30  5:46           ` Andrej Borsenkow
1997-07-30  6:11           ` Bart Schaefer
1997-07-30  6:51             ` Zoltan Hidvegi
1997-07-30  7:33               ` Bart Schaefer
1997-07-30  8:18           ` Andrew Main
1997-07-30 15:54             ` Andrej Borsenkow
1997-07-30 17:05               ` Bart Schaefer
1997-08-01 13:17                 ` Andrej Borsenkow
1997-08-01 18:18                   ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199707290604.CAA02191@hzoli.home \
    --to=hzoli@frontiernet.net \
    --cc=schaefer@brasslantern.com \
    --cc=zefram@tao.co.uk \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).