From 6bdb14edfd725f7a5d8db8c19a570b6a8cdee033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 9 Jan 2009 18:00:11 +0000 Subject: [PATCH] tokenize: avoid "terminate called after throwing an instance of 'std::out_of_range'" --- src/tokenize.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tokenize.cpp b/src/tokenize.cpp index 1491cc54e..6f2c1b5af 100644 --- a/src/tokenize.cpp +++ b/src/tokenize.cpp @@ -281,7 +281,8 @@ void Tokenizer::tokenizeCode(std::istream &code, const unsigned int FileIndex) { // Extract the filename line.erase(0, line.find("\"") + 1); - line.erase(line.find("\"")); + if (line.find("\"") != std::string::npos) + line.erase(line.find("\"")); // Relative path.. if (_files.back().find_first_of("\\/") != std::string::npos)