From 1ad19232c4bbecb06e6acbb2a3a538544a28e1f2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 11 May 2018 12:02:19 +0200 Subject: Don't return negative numbers from the flex tokenizer Fixes #1374. Closes #2129. --- src/libexpr/lexer.l | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/libexpr/lexer.l') diff --git a/src/libexpr/lexer.l b/src/libexpr/lexer.l index 8855d794ea98..29ca327c1e4e 100644 --- a/src/libexpr/lexer.l +++ b/src/libexpr/lexer.l @@ -209,7 +209,11 @@ or { return OR_KW; } \#[^\r\n]* /* single-line comments */ \/\*([^*]|\*+[^*/])*\*+\/ /* long comments */ -{ANY} return yytext[0]; +{ANY} { + /* Don't return a negative number, as this will cause + Bison to stop parsing without an error. */ + return (unsigned char) yytext[0]; + } } -- cgit 1.4.1