From 78fa9bca095166663322e674d62bd86d72d45b33 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 9 Oct 2013 08:56:28 +0200 Subject: [PATCH] config: Make sure we're not inside a comment when reaching the end of a config file. Fixes #4821 --- lib/config/config_lexer.ll | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/config/config_lexer.ll b/lib/config/config_lexer.ll index d2d95f437..6729d966e 100644 --- a/lib/config/config_lexer.ll +++ b/lib/config/config_lexer.ll @@ -183,6 +183,14 @@ static char *lb_steal(lex_buf *lb) "*" /* ignore star */ } +<> { + std::ostringstream msgbuf; + msgbuf << "End-of-file while in comment: " << yytext << " " << *yylloc; + ConfigCompilerContext::GetInstance()->AddMessage(true, msgbuf.str()); + yyterminate(); + } + + \/\/[^\n]* /* ignore C++-style comments */ [ \t\r\n] /* ignore whitespace */ -- 2.49.0