From bd734a9610b261748d63ac87138704638ed31d57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 15 Sep 2012 12:53:11 +0200 Subject: [PATCH] Fixed #3684 (Preprocessor: #include handling is searching directories in the wrong order) --- lib/preprocessor.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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; }