diff --git a/libpwrutils/pathsearch.cpp b/libpwrutils/pathsearch.cpp index c89b7a4bf1af495ca866ffbc62bb7a3656d24ff3..15f4e998c827d1df2ef1692f9fde71ff14869cbe 100644 --- a/libpwrutils/pathsearch.cpp +++ b/libpwrutils/pathsearch.cpp @@ -75,10 +75,21 @@ std::string PathSearcherBase::find_file(const std::string& filename, const std::string& info) { boost::filesystem::path i(filename); + if (i.is_complete()) { + if (boost::filesystem::exists(i) && + !boost::filesystem::is_directory(i)) { + if (verbose_loading_) { + std::cerr << "Found " << info << " file: " + << i.string() << "\n"; + } + return i.string(); + } + return ""; + } foreach (const std::string& s, paths_) { boost::filesystem::path pi = s / i; if (boost::filesystem::exists(pi) && - boost::filesystem::is_regular(pi)) { + !boost::filesystem::is_directory(pi)) { if (verbose_loading_) { std::cerr << "Found " << info << " file: " << pi.string() << "\n";