mirror of
https://github.com/gulrak/filesystem.git
synced 2026-09-14 14:52:15 +08:00
fix: resolve relative targets in Windows copy_symlink()
Signed-off-by: hannahgreendesk <hannahgreendesk@users.noreply.github.com>
This commit is contained in:
parent
2b4d7f239e
commit
51f454da86
@ -4085,7 +4085,9 @@ GHC_INLINE void copy_symlink(const path& existing_symlink, const path& new_symli
|
||||
ec.clear();
|
||||
auto to = read_symlink(existing_symlink, ec);
|
||||
if (!ec) {
|
||||
if (exists(to, ec) && is_directory(to, ec)) {
|
||||
// Relative targets are relative to the source link parent (#211).
|
||||
path lookup = to.is_absolute() ? to : (existing_symlink.parent_path() / to);
|
||||
if (exists(lookup, ec) && is_directory(lookup, ec)) {
|
||||
create_directory_symlink(to, new_symlink, ec);
|
||||
}
|
||||
else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user