1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-05 11:01:13 +02:00

26617 c.f. Tomáš Smetana, 26610: comments weren't handled in $(...)

This commit is contained in:
Peter Stephenson 2009-02-26 23:01:48 +00:00
parent bf0ef69f42
commit 3d63a33407
2 changed files with 17 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2009-02-26 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 26617, c.f. Tomáš Smetana, 26610: Src/lex.c: comments
weren't handled in $(...).
2009-02-26 Peter Stephenson <pws@csr.com> 2009-02-26 Peter Stephenson <pws@csr.com>
* Frank Terbeck: 26612: Doc/Zsh/contrib.yo: VCS info documentation * Frank Terbeck: 26612: Doc/Zsh/contrib.yo: VCS info documentation
@ -11247,5 +11252,5 @@
***************************************************** *****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL * This is used by the shell to define $ZSH_PATCHLEVEL
* $Revision: 1.4581 $ * $Revision: 1.4582 $
***************************************************** *****************************************************

View file

@ -1802,16 +1802,18 @@ exalias(void)
static int static int
skipcomm(void) skipcomm(void)
{ {
int pct = 1, c; int pct = 1, c, start = 1;
cmdpush(CS_CMDSUBST); cmdpush(CS_CMDSUBST);
SETPARBEGIN SETPARBEGIN
c = Inpar; c = Inpar;
do { do {
int iswhite;
add(c); add(c);
c = hgetc(); c = hgetc();
if (itok(c) || lexstop) if (itok(c) || lexstop)
break; break;
iswhite = isep(c);
switch (c) { switch (c) {
case '(': case '(':
pct++; pct++;
@ -1854,7 +1856,15 @@ skipcomm(void)
else else
add(c); add(c);
break; break;
case '#':
if (start) {
add(c);
while ((c = hgetc()) != '\n' && !lexstop)
add(c);
}
break;
} }
start = iswhite;
} }
while (pct); while (pct);
if (!lexstop) if (!lexstop)