From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id EAA06392 for ; Mon, 22 Jul 1996 04:55:02 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id OAA13660; Sun, 21 Jul 1996 14:51:25 -0400 (EDT) Resent-Date: Sun, 21 Jul 1996 14:51:25 -0400 (EDT) From: "Bart Schaefer" Message-Id: <960721115135.ZM19185@candle.brasslantern.com> Date: Sun, 21 Jul 1996 11:51:35 -0700 In-Reply-To: "Bart Schaefer" "Problematic change in alias behavior in pre3" (Jul 21, 10:41am) References: <960721104147.ZM18816@candle.brasslantern.com> Reply-To: schaefer@nbn.com X-Mailer: Z-Mail (4.0b.702 02jul96) To: zsh-workers@math.gatech.edu Subject: Re: Problematic change in alias behavior in pre3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"0X2pU2.0.ML3.imdyn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1733 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Jul 21, 10:41am, Bart Schaefer wrote: } Subject: Problematic change in alias behavior in pre3 } } zsh% alias show="noglob show" } zsh% show=() } zsh: parse error near `)' } } Why does the existence of the alias mess up the variable assignment? I don't know how/why this worked in pre2, but in pre3 gettokstr() returns "show=stuff" for ENVSTRING, but only "show" for ENVARRAY. Thus the token "show" is incmdpos when when exalias(), and thus is subject to expansion. It's not sufficient to assign incmdpos=0 when ENVARRAY, because then this kind of thing fails: zsh% alias foo='echo help' zsh% show=(stuff) foo bar zsh: command not found: foo So here's what I came up with; I return tokstr "show=" from the lexer for ENVARRAY, and then strip off the '=' when parsing, as is done for ENVSTRING. It's impossible to create an alias name containing an '=' (maybe that's a bug, too?) so exalias() can't possibly succeed on "show=". *** Src/lex.c.0 Thu Jul 18 19:15:13 1996 --- Src/lex.c Sun Jul 21 11:26:22 1996 *************** *** 853,858 **** --- 853,859 ---- incmdpos && !bct && !brct) { e = hgetc(); if (e == '(' && incmdpos) { + add('='); *bptr = '\0'; return ENVARRAY; } *** Src/parse.c.0 Fri Jul 19 11:17:12 1996 --- Src/parse.c Sun Jul 21 11:29:49 1996 *************** *** 916,922 **** v->type = PM_ARRAY; incmdpos = 0; ! v->name = tokstr; cmdpush(CS_ARRAY); yylex(); v->arr = par_nl_wordlist(); --- 916,922 ---- v->type = PM_ARRAY; incmdpos = 0; ! equalsplit(v->name = tokstr, &v->str); cmdpush(CS_ARRAY); yylex(); v->arr = par_nl_wordlist(); -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.nbn.com/people/lantern New male in /home/schaefer: >N 2 Justin William Schaefer Sat May 11 03:43 53/4040 "Happy Birthday"