make RenameFile() on Windows also replace the file (#2060)
* make RenameFile() on Windows also replace the file * Add MOVEFILE_COPY_ALLOWED to MoveFileExA
This commit is contained in:
parent
d56dc62e03
commit
908ffdb523
@ -639,7 +639,7 @@ static cell_t sm_RenameFile(IPluginContext *pContext, const cell_t *params)
|
||||
g_pSM->BuildPath(Path_Game, old_realpath, sizeof(old_realpath), "%s", oldpath);
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
return (MoveFileA(old_realpath, new_realpath)) ? 1 : 0;
|
||||
return (MoveFileExA(old_realpath, new_realpath, MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING)) ? 1 : 0;
|
||||
#elif defined PLATFORM_POSIX
|
||||
return (rename(old_realpath, new_realpath)) ? 0 : 1;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user