1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-09-28 06:49:49 +02:00

40995: Don't disable alias expansion when finding command substitution limits

This is needed in some unusual cases in order to identify the exit
condition without encountering a parse error.
This commit is contained in:
Peter Stephenson 2017-04-23 17:06:26 +01:00
parent 3c78f14d5c
commit 68466f327e
3 changed files with 16 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2017-04-23 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 40995: Src/lex.c, Test/D08cmdsubst.ztst: we need to expand
aliases when identifiying the end of a command substitution as
sometimes we can hit a parse error before.
2017-04-23 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
* 40994: Src/utils.c: unmeta_one() need not count Meta

View File

@ -2060,9 +2060,7 @@ skipcomm(void)
int new_lexstop, new_lex_add_raw;
int save_infor = infor;
struct lexbufstate new_lexbuf;
int noalias = noaliases;
noaliases = 1;
infor = 0;
cmdpush(CS_CMDSUBST);
SETPARBEGIN
@ -2189,7 +2187,6 @@ skipcomm(void)
SETPAREND
cmdpop();
infor = save_infor;
noaliases = noalias;
return lexstop;
#endif

View File

@ -167,3 +167,13 @@
empty=$() && print "'$empty'"
0:Empty $() is a valid assignment
>''
(
setopt ignoreclosebraces
alias OPEN='{' CLOSE='};'
eval '{ OPEN print hi; CLOSE }
var=$({ OPEN print bye; CLOSE}) && print $var'
)
0:Alias expansion needed in parsing substituions
>hi
>bye