diff options
Diffstat (limited to 'Libraries/LibGUI/CppLexer.cpp')
-rw-r--r-- | Libraries/LibGUI/CppLexer.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Libraries/LibGUI/CppLexer.cpp b/Libraries/LibGUI/CppLexer.cpp index fcf5bd7f8c..c901437d00 100644 --- a/Libraries/LibGUI/CppLexer.cpp +++ b/Libraries/LibGUI/CppLexer.cpp @@ -363,16 +363,16 @@ Vector<CppToken> CppLexer::lex() begin_token(); if (peek() == '<' || peek() == '"') { char closing = consume() == '<' ? '>' : '"'; - while (peek() != closing && peek() != '\n') + while (peek() && peek() != closing && peek() != '\n') consume(); - if (consume() == '\n') { + if (peek() && consume() == '\n') { commit_token(CppToken::Type::IncludePath); continue; - } else { - commit_token(CppToken::Type::IncludePath); - begin_token(); } + + commit_token(CppToken::Type::IncludePath); + begin_token(); } } |