diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index 1b1870d30..3c6ae34eb 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -1797,6 +1797,12 @@ Preprocessor::HeaderTypes Preprocessor::getHeaderFileName(std::string &str) */ static bool openHeader(std::string &filename, const std::list &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 includePaths2(includePaths); includePaths2.push_front(""); @@ -1810,12 +1816,6 @@ static bool openHeader(std::string &filename, const std::list &incl fin.clear(); } - fin.open((filePath + filename).c_str()); - if (fin.is_open()) { - filename = filePath + filename; - return true; - } - return false; }