From e1ca64b56ee438cf718a326969bc65a256e22c0c Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Fri, 27 Jun 2014 08:21:53 +0900 Subject: [PATCH] block comment reader must not consume the character right after the comment end --- src/read.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/read.c b/src/read.c index d123059c..2e7bb19f 100644 --- a/src/read.c +++ b/src/read.c @@ -69,24 +69,22 @@ static pic_value read_block_comment(pic_state *pic, struct pic_port *port, char c) { char x, y; - int i; + int i = 1; UNUSED(pic); UNUSED(c); - x = next(port); y = next(port); - i = 1; - while (x != EOF && y != EOF && i > 0) { + while (y != EOF && i > 0) { + x = y; + y = next(port); if (x == '|' && y == '#') { i--; } if (x == '#' && y == '|') { i++; } - x = y; - y = next(port); } return pic_undef_value();