From 34ec1112a921e1b147a56149dd4e5fb1ece68c26 Mon Sep 17 00:00:00 2001 From: PKEuS Date: Mon, 26 Oct 2015 12:17:29 +0100 Subject: [PATCH] Removed bailout in case a file (without include guards) is included twice. (#5455) --- lib/preprocessor.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index 9755e9c49..d677c6836 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -2265,7 +2265,7 @@ void Preprocessor::handleIncludes(std::string &code, const std::string &filePath if (start != std::string::npos) endfilePos = start; } - std::set handledFiles; + while ((pos = code.find("#include", pos)) != std::string::npos) { if (_settings.terminated()) return; @@ -2306,14 +2306,6 @@ void Preprocessor::handleIncludes(std::string &code, const std::string &filePath filename = Path::simplifyPath(filename); std::string tempFile = filename; std::transform(tempFile.begin(), tempFile.end(), tempFile.begin(), tolowerWrapper); - if (handledFiles.find(tempFile) != handledFiles.end()) { - // We have processed this file already once, skip - // it this time to avoid eternal loop. - fin.close(); - continue; - } - - handledFiles.insert(tempFile); processedFile = Preprocessor::read(fin, filename); fin.close(); }