mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-09-29 15:31:14 +00:00
patch_manager: use rename to back up old patch file
This commit is contained in:
parent
44371dedd9
commit
8d56dd1969
@ -942,10 +942,10 @@ bool patch_manager_dialog::handle_json(const QByteArray& data)
|
||||
// Back up current patch file if possible
|
||||
if (fs::is_file(path))
|
||||
{
|
||||
if (const std::string path_old = path + ".old";
|
||||
!fs::copy_file(path, path_old, true))
|
||||
if (const std::string back_up_path = path + ".old";
|
||||
!fs::rename(path, back_up_path, true))
|
||||
{
|
||||
patch_log.error("Could not back up current patches to %s (%s)", path_old, fs::g_tls_error);
|
||||
patch_log.error("Could not back up current patches to %s (%s)", back_up_path, fs::g_tls_error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user