fix file rename on Win9x
This commit is contained in:
@@ -76,10 +76,12 @@ int WinMoveFileInternal( const CString &sOldPath, const CString &sNewPath )
|
|||||||
if( MoveFileEx( sOldPath, sNewPath, MOVEFILE_REPLACE_EXISTING ) )
|
if( MoveFileEx( sOldPath, sNewPath, MOVEFILE_REPLACE_EXISTING ) )
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if( GetLastError() == ERROR_NOT_SUPPORTED || GetLastError() == ERROR_CALL_NOT_IMPLEMENTED )
|
// On Win9x, MoveFileEx is expected to fail (returns ERROR_CALL_NOT_IMPLEMENTED).
|
||||||
return 0;
|
DWORD err = GetLastError();
|
||||||
|
if( err == ERROR_CALL_NOT_IMPLEMENTED )
|
||||||
Win9x = true;
|
Win9x = true;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( MoveFile( sOldPath, sNewPath ) )
|
if( MoveFile( sOldPath, sNewPath ) )
|
||||||
|
|||||||
Reference in New Issue
Block a user