1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:58:11 +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:
angel 2020-04-19 16:52:46 +02:00 committed by Andreas Kling
parent fc09767872
commit 11054fc9f9

View file

@ -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(),