projects
/
platform
/
upstream
/
flatbuffers.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b822480
)
NoError was returning on DoParse method when file was empty (#4208)
author
Louis-Paul CORDIER
<lp.cordier@dynamixyz.com>
Fri, 10 Mar 2017 16:50:44 +0000
(17:50 +0100)
committer
Wouter van Oortmerssen
<aardappel@gmail.com>
Fri, 10 Mar 2017 16:50:44 +0000
(08:50 -0800)
* NoError was returning on DoParse method when file was empty.
* change NoError message in DoParse.
src/idl_parser.cpp
patch
|
blob
|
history
diff --git
a/src/idl_parser.cpp
b/src/idl_parser.cpp
index
7adfcca
..
0d689da
100644
(file)
--- a/
src/idl_parser.cpp
+++ b/
src/idl_parser.cpp
@@
-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: