From 1dedd7d54f9953903f34d83f5f6aa5a6b833a098 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 21 Dec 2003 07:57:03 +0000 Subject: [PATCH] 9x overwrite fix --- stepmania/src/RageFileDriverDirect.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/stepmania/src/RageFileDriverDirect.cpp b/stepmania/src/RageFileDriverDirect.cpp index 30b592c494..ebe73ae1c4 100644 --- a/stepmania/src/RageFileDriverDirect.cpp +++ b/stepmania/src/RageFileDriverDirect.cpp @@ -82,6 +82,15 @@ static int WinMoveFile( const CString sOldPath, const CString sNewPath ) Win9x = true; } + if( MoveFile( sOldPath, sNewPath ) ) + return 1; + + if( GetLastError() != ERROR_ALREADY_EXISTS ) + return 0; + + if( !DeleteFile( sNewPath ) ) + return 0; + return MoveFile( sOldPath, sNewPath ); } #endif