Fixed #6396 (There are false negatives when --include is used)

This commit is contained in:
Daniel Marjamäki 2015-01-03 18:22:52 +01:00
parent 267552779d
commit 014f8e3c71
1 changed files with 5 additions and 0 deletions

View File

@ -2273,6 +2273,11 @@ void Preprocessor::handleIncludes(std::string &code, const std::string &filePath
paths.push_back(path); paths.push_back(path);
std::string::size_type pos = 0; std::string::size_type pos = 0;
std::string::size_type endfilePos = 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<std::string> handledFiles; std::set<std::string> handledFiles;
while ((pos = code.find("#include", pos)) != std::string::npos) { while ((pos = code.find("#include", pos)) != std::string::npos) {
if (_settings && _settings->terminated()) if (_settings && _settings->terminated())