mirror of
https://github.com/transmission/transmission.git
synced 2026-02-14 23:19:34 +00:00
fix: incorrectly set error when moving across filesystems (#8167)
This commit is contained in:
@@ -599,14 +599,21 @@ bool tr_file_move(std::string_view oldpath_in, std::string_view newpath_in, bool
|
||||
return false;
|
||||
}
|
||||
|
||||
/* they might be on the same filesystem... */
|
||||
if (tr_sys_path_rename(oldpath, newpath, error))
|
||||
if (allow_copy)
|
||||
{
|
||||
return true;
|
||||
// they might be on the same filesystem...
|
||||
if (tr_sys_path_rename(oldpath, newpath))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!allow_copy)
|
||||
else
|
||||
{
|
||||
// do the actual moving
|
||||
if (tr_sys_path_rename(oldpath, newpath, error))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
error->prefix_message("Unable to move file: ");
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user