Skip to content
Snippets Groups Projects
Commit 9568d4e4 authored by ilor's avatar ilor
Browse files

pathsearcher update: handle absolute (complete) paths, allow symlinks etc

parent 46b6ba11
Branches
No related merge requests found
......@@ -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";
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment