Don't attempt to get the working directory of a URL
This commit is contained in:
@@ -118,7 +118,12 @@ namespace proc {
|
|||||||
return boost::filesystem::path();
|
return boost::filesystem::path();
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_LOG(debug) << "Parsed executable ["sv << parts.at(0) << "] from command ["sv << cmd << ']';
|
BOOST_LOG(debug) << "Parsed target ["sv << parts.at(0) << "] from command ["sv << cmd << ']';
|
||||||
|
|
||||||
|
// If the target is a URL, don't parse any further here
|
||||||
|
if (parts.at(0).find("://") != std::string::npos) {
|
||||||
|
return boost::filesystem::path();
|
||||||
|
}
|
||||||
|
|
||||||
// If the cmd path is not an absolute path, resolve it using our PATH variable
|
// If the cmd path is not an absolute path, resolve it using our PATH variable
|
||||||
boost::filesystem::path cmd_path(parts.at(0));
|
boost::filesystem::path cmd_path(parts.at(0));
|
||||||
@@ -130,7 +135,7 @@ namespace proc {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_LOG(debug) << "Resolved executable ["sv << parts.at(0) << "] to path ["sv << cmd_path << ']';
|
BOOST_LOG(debug) << "Resolved target ["sv << parts.at(0) << "] to path ["sv << cmd_path << ']';
|
||||||
|
|
||||||
// Now that we have a complete path, we can just use parent_path()
|
// Now that we have a complete path, we can just use parent_path()
|
||||||
return cmd_path.parent_path();
|
return cmd_path.parent_path();
|
||||||
|
|||||||
Reference in New Issue
Block a user