From 014f8e3c715c9b0f3d46f109daeb76128bed31c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 3 Jan 2015 18:22:52 +0100 Subject: [PATCH] Fixed #6396 (There are false negatives when --include is used) --- lib/preprocessor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index 726972c1c..5eaf4fd09 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -2273,6 +2273,11 @@ void Preprocessor::handleIncludes(std::string &code, const std::string &filePath paths.push_back(path); std::string::size_type pos = 0; std::string::size_type endfilePos = 0; + if (code.compare(0,7U,"#file \"")==0) { + const std::string::size_type start = code.find("#file \"" + filePath, 7U); + if (start != std::string::npos) + endfilePos = start; + } std::set handledFiles; while ((pos = code.find("#include", pos)) != std::string::npos) { if (_settings && _settings->terminated())