mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-18 07:05:39 +00:00
Merge pull request #29 from joolswills/symlink_support
Added symlink support on removeCommonPath
This commit is contained in:
commit
bfe13f11af
|
@ -110,7 +110,8 @@ fs::path removeCommonPath(const fs::path& path, const fs::path& relativeTo, bool
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
fs::path p = fs::canonical(path);
|
// if it's a symlink we don't want to apply fs::canonical on it, otherwise we'll lose the current parent_path
|
||||||
|
fs::path p = (fs::is_symlink(path) ? fs::canonical(path.parent_path()) / path.filename() : fs::canonical(path));
|
||||||
fs::path r = fs::canonical(relativeTo);
|
fs::path r = fs::canonical(relativeTo);
|
||||||
|
|
||||||
if(p.root_path() != r.root_path())
|
if(p.root_path() != r.root_path())
|
||||||
|
|
Loading…
Reference in a new issue