FileCopy sanity check

This commit is contained in:
Glenn Maynard
2004-02-17 22:12:39 +00:00
parent 4af86cda13
commit 6084f5fa3b
+6
View File
@@ -1119,6 +1119,12 @@ void FileWrite(RageFile& f, float fWrite)
bool FileCopy( CString sSrcFile, CString sDstFile )
{
if( !sSrcFile.CompareNoCase(sDstFile) )
{
LOG->Warn( "Tried to copy \"%s\" over itself", sSrcFile.c_str() );
return false;
}
RageFile in;
if( !in.Open(sSrcFile, RageFile::READ) )
return false;