config: Make sure we're not inside a comment when reaching the end of a config file.

Fixes #4821
This commit is contained in:
Gunnar Beutner 2013-10-09 08:56:28 +02:00
parent 3f922e5eac
commit 78fa9bca09
1 changed files with 8 additions and 0 deletions

View File

@ -183,6 +183,14 @@ static char *lb_steal(lex_buf *lb)
"*" /* ignore star */ "*" /* ignore star */
} }
<C_COMMENT><<EOF>> {
std::ostringstream msgbuf;
msgbuf << "End-of-file while in comment: " << yytext << " " << *yylloc;
ConfigCompilerContext::GetInstance()->AddMessage(true, msgbuf.str());
yyterminate();
}
\/\/[^\n]* /* ignore C++-style comments */ \/\/[^\n]* /* ignore C++-style comments */
[ \t\r\n] /* ignore whitespace */ [ \t\r\n] /* ignore whitespace */