mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-29 17:31:02 +01:00
26617 c.f. Tomáš Smetana, 26610: comments weren't handled in $(...)
This commit is contained in:
parent
bf0ef69f42
commit
3d63a33407
2 changed files with 17 additions and 2 deletions
12
Src/lex.c
12
Src/lex.c
|
|
@ -1802,16 +1802,18 @@ exalias(void)
|
|||
static int
|
||||
skipcomm(void)
|
||||
{
|
||||
int pct = 1, c;
|
||||
int pct = 1, c, start = 1;
|
||||
|
||||
cmdpush(CS_CMDSUBST);
|
||||
SETPARBEGIN
|
||||
c = Inpar;
|
||||
do {
|
||||
int iswhite;
|
||||
add(c);
|
||||
c = hgetc();
|
||||
if (itok(c) || lexstop)
|
||||
break;
|
||||
iswhite = isep(c);
|
||||
switch (c) {
|
||||
case '(':
|
||||
pct++;
|
||||
|
|
@ -1854,7 +1856,15 @@ skipcomm(void)
|
|||
else
|
||||
add(c);
|
||||
break;
|
||||
case '#':
|
||||
if (start) {
|
||||
add(c);
|
||||
while ((c = hgetc()) != '\n' && !lexstop)
|
||||
add(c);
|
||||
}
|
||||
break;
|
||||
}
|
||||
start = iswhite;
|
||||
}
|
||||
while (pct);
|
||||
if (!lexstop)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue