summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-04-26 09:05:02 +0900
committerYukihiro Matsumoto <[email protected]>2012-04-26 09:05:02 +0900
commit5aa1c95710f76ce4cb35a27ccb402f9394edd524 (patch)
treed1bd8d981626940e3eb17cbbe11b25c566fc95c0
parent0486c48b1aec2509076b6c2cc03ccc826d802c7d (diff)
downloadmruby-5aa1c95710f76ce4cb35a27ccb402f9394edd524.tar.gz
mruby-5aa1c95710f76ce4cb35a27ccb402f9394edd524.zip
parse.y: skip() should not ignore end-of-file; fix #55
-rw-r--r--src/parse.y7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/parse.y b/src/parse.y
index f264a7f36..be18b1d35 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -3038,8 +3038,11 @@ skip(parser_state *p, char term)
{
int c;
- while ((c = nextc(p)) != term)
- ;
+ for (;;) {
+ c = nextc(p);
+ if (c < 0) break;
+ if (c == term) break;
+ }
}
static int