From 07d5965c812fa5e82dc4d3eb32b37540b7c91598 Mon Sep 17 00:00:00 2001 From: Zbigniew Mandziejewicz Date: Wed, 22 Oct 2014 22:40:03 +0800 Subject: [PATCH] Fixes #90 - flatc chokes on IDL files starting with a comment Change-Id: I5ab692ceb6809493720c1bff69a2e3210efd4618 --- src/idl_parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/idl_parser.cpp b/src/idl_parser.cpp index 8189a147e..3091fe607 100644 --- a/src/idl_parser.cpp +++ b/src/idl_parser.cpp @@ -184,7 +184,7 @@ void Parser::Next() { const char *start = ++cursor_; while (*cursor_ && *cursor_ != '\n') cursor_++; if (*start == '/') { // documentation comment - if (!seen_newline) + if (cursor_ != source_ && !seen_newline) Error("a documentation comment should be on a line on its own"); doc_comment_.push_back(std::string(start + 1, cursor_)); }