From 3d63a33407f1b4e324b83a87d55b27303a2fcdb8 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 26 Feb 2009 23:01:48 +0000 Subject: [PATCH] =?UTF-8?q?26617=20c.f.=20Tom=C3=A1=C5=A1=20Smetana,=20266?= =?UTF-8?q?10:=20comments=20weren't=20handled=20in=20$(...)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChangeLog | 7 ++++++- Src/lex.c | 12 +++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b227ac0c1..782dd06f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-02-26 Peter Stephenson + + * 26617, c.f. Tomáš Smetana, 26610: Src/lex.c: comments + weren't handled in $(...). + 2009-02-26 Peter Stephenson * Frank Terbeck: 26612: Doc/Zsh/contrib.yo: VCS info documentation @@ -11247,5 +11252,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.4581 $ +* $Revision: 1.4582 $ ***************************************************** diff --git a/Src/lex.c b/Src/lex.c index 5637a2106..6e14612f7 100644 --- a/Src/lex.c +++ b/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)