mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
FileManager: Fix recursive copy on drag
When a drag operation is accepted, we don't check whether the source nodes contain the destination directory. This could trigger an unwanted recursive copy.
This commit is contained in:
parent
fc09767872
commit
11054fc9f9
Notes:
sideshowbarker
2024-07-19 17:36:03 +09:00
Author: https://github.com/anpep Commit: https://github.com/SerenityOS/serenity/commit/11054fc9f9e Pull-request: https://github.com/SerenityOS/serenity/pull/1875
1 changed files with 1 additions and 1 deletions
|
@ -684,7 +684,7 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio
|
|||
return;
|
||||
|
||||
for (auto& url_to_copy : urls) {
|
||||
if (!url_to_copy.is_valid())
|
||||
if (!url_to_copy.is_valid() || url_to_copy.path() == target_node.full_path(directory_view.model()))
|
||||
continue;
|
||||
auto new_path = String::format("%s/%s",
|
||||
target_node.full_path(directory_view.model()).characters(),
|
||||
|
|
Loading…
Reference in a new issue