mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
Merge pull request #910 from fryshorts/linux-safe-replace
libobs: Fix os_safe_replace not working linux
This commit is contained in:
@@ -434,7 +434,7 @@ int os_rename(const char *old_path, const char *new_path)
|
||||
|
||||
int os_safe_replace(const char *target, const char *from, const char *backup)
|
||||
{
|
||||
if (backup && rename(target, backup) != 0)
|
||||
if (backup && os_file_exists(target) && rename(target, backup) != 0)
|
||||
return -1;
|
||||
return rename(from, target);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user