mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:27:35 +00:00
LibCore: Fix link_file inverting src and dst paths on duplicate names
File::link_file takes the dst_path then the src_path so on duplicate names we tried to create a link at the original file location, which then flipped the parameters back round again and we ended up with a broken link from "dst_path (1)" to "src_path (1)".
This commit is contained in:
parent
19de6bb1cc
commit
fd3735199b
1 changed files with 1 additions and 1 deletions
|
@ -497,7 +497,7 @@ Result<void, OSError> File::link_file(String const& dst_path, String const& src_
|
|||
++duplicate_count;
|
||||
}
|
||||
if (duplicate_count != 0) {
|
||||
return link_file(src_path, get_duplicate_name(dst_path, duplicate_count));
|
||||
return link_file(get_duplicate_name(dst_path, duplicate_count), src_path);
|
||||
}
|
||||
int rc = symlink(src_path.characters(), dst_path.characters());
|
||||
if (rc < 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue