file-operations-copy-file unintended behaviour
The nautilus_file_operations_copy_file function has an argument called "new_name" which works as following: if you set it to NULL when using the function, the files are copied as they are; otherwise, the copied file's name is set to the given argument after the copying is done. This works fine as long as it's a single file or an empty directory.
If it's a directory containing one file, then the child will be renamed to the given string as well (which is misleading). If the directory contains more than one file/subdirectory, the function tries to name all of them to the new_name value, which doesn't work.
Given the hierarchy:
Copying dir1 to dir2 and setting the new_name value to "copy_result" gives us:
The result should be:
(or not proceed with the operation if the directory isn't empty)