NoError was returning on DoParse method when file was empty (#4208)

* NoError was returning on DoParse method when file was empty.

* change NoError message in DoParse.
This commit is contained in:
Louis-Paul CORDIER
2017-03-10 17:50:44 +01:00
committed by Wouter van Oortmerssen
parent b8224809ad
commit e7e4dc755d

View File

@@ -1874,6 +1874,10 @@ CheckedError Parser::DoParse(const char *source, const char **include_paths,
namespaces_.push_back(new Namespace());
ECHECK(SkipByteOrderMark());
NEXT();
if (Is(kTokenEof))
return Error("input file is empty");
// Includes must come before type declarations:
for (;;) {
// Parse pre-include proto statements if any: