mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 03:25:16 +00:00
patch_manager: use rename to back up old patch file
This commit is contained in:
parent
44371dedd9
commit
8d56dd1969
1 changed files with 3 additions and 3 deletions
|
@ -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…
Add table
Reference in a new issue