Fixed #3684 (Preprocessor: #include handling is searching directories in the wrong order)

This commit is contained in:
Daniel Marjamäki 2012-09-15 12:53:11 +02:00
parent f1ebd99dc2
commit bd734a9610
1 changed files with 6 additions and 6 deletions

View File

@ -1797,6 +1797,12 @@ Preprocessor::HeaderTypes Preprocessor::getHeaderFileName(std::string &str)
*/ */
static bool openHeader(std::string &filename, const std::list<std::string> &includePaths, const std::string &filePath, std::ifstream &fin) static bool openHeader(std::string &filename, const std::list<std::string> &includePaths, const std::string &filePath, std::ifstream &fin)
{ {
fin.open((filePath + filename).c_str());
if (fin.is_open()) {
filename = filePath + filename;
return true;
}
std::list<std::string> includePaths2(includePaths); std::list<std::string> includePaths2(includePaths);
includePaths2.push_front(""); includePaths2.push_front("");
@ -1810,12 +1816,6 @@ static bool openHeader(std::string &filename, const std::list<std::string> &incl
fin.clear(); fin.clear();
} }
fin.open((filePath + filename).c_str());
if (fin.is_open()) {
filename = filePath + filename;
return true;
}
return false; return false;
} }