From 8afc7443e4e39e8c43d07a935398cfd147b5cb4d Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 11 Jul 2015 11:25:24 -0400 Subject: [PATCH] Lexer: Fixed bug that allowed unterminated quotes strings, again --- src/Lexer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Lexer.cpp b/src/Lexer.cpp index 4fc125167..992eb7a1c 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -1218,8 +1218,10 @@ bool Lexer::readWord ( word += utf8_character (utf8_next_char (text, cursor)); } - // Word has to at least contain the quotes. - return word.length () >= 2 ? true : false; + // Verify termination. + return word[0] == quote && + word[word.length () - 1] == quote && + word.length () >= 2; } ////////////////////////////////////////////////////////////////////////////////