diff --git a/simplecpp.cpp b/simplecpp.cpp index 4aac986f..32d2b007 100755 --- a/simplecpp.cpp +++ b/simplecpp.cpp @@ -2862,11 +2862,15 @@ static std::string openHeader(std::ifstream &f, const simplecpp::DUI &dui, const if (systemheader) { ret = openHeaderIncludePath(f, dui, header); - return ret.empty() ? openHeaderRelative(f, sourcefile, header) : ret; + if (ret.empty()) + return openHeaderRelative(f, sourcefile, header); + return ret; } ret = openHeaderRelative(f, sourcefile, header); - return ret.empty() ? openHeaderIncludePath(f, dui, header) : ret; + if (ret.empty()) + openHeaderIncludePath(f, dui, header); + return ret; } static std::string getFileName(const std::map &filedata, const std::string &sourcefile, const std::string &header, const simplecpp::DUI &dui, bool systemheader)