Commit b221ecdd authored by Aloshi's avatar Aloshi

Fix for empty paths breaking in getCanonicalPath().

parent e5ac2253
......@@ -62,16 +62,11 @@ Eigen::Vector2f roundVector(const Eigen::Vector2f& vec)
return ret;
}
// embedded resources, e.g. ":/font.ttf", need to be properly handled too
std::string getCanonicalPath(const std::string& path)
{
// embedded resources, e.g. ":/font.ttf", need to be properly handled too
try
{
const std::string canonical = boost::filesystem::canonical(path).generic_string();
return canonical.empty() ? path : canonical;
}
catch (boost::filesystem::filesystem_error& e)
{
if(path.empty() || !boost::filesystem::exists(path))
return path;
}
return boost::filesystem::canonical(path).generic_string();
}
Markdown is supported
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