diff --git a/src/lib/utility/file/FilePath.cpp b/src/lib/utility/file/FilePath.cpp index 32c3ab87..bf56d286 100644 --- a/src/lib/utility/file/FilePath.cpp +++ b/src/lib/utility/file/FilePath.cpp @@ -165,7 +165,14 @@ FilePath FilePath::canonical() const if (boost::filesystem::is_symlink(canonicalPath)) { - canonicalPath = boost::filesystem::canonical(canonicalPath); + boost::filesystem::path symlink = boost::filesystem::read_symlink(canonicalPath); + if (!symlink.empty()) + { + // on Windows the read_symlink function discards the drive letter (this is a boost bug). Therefore + // we need to make the path absolute again. We also have to discard the trailing \0 characters so + // that we can continue appending to the path. + canonicalPath = utility::substrBeforeFirst(boost::filesystem::absolute(symlink).string(), '\0'); + } } }