simplify
This commit is contained in:
@@ -1117,15 +1117,12 @@ bool FileCopy( CString sSrcFile, CString sDstFile )
|
|||||||
if( !out.Open(sDstFile, RageFile::WRITE) )
|
if( !out.Open(sDstFile, RageFile::WRITE) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#define CLEANUP_AND_RETURN(b) { delete data; return b; }
|
CString data;
|
||||||
|
if( in.Read(data) == -1 )
|
||||||
int size = in.GetFileSize();
|
return false;
|
||||||
char *data = new char[size];
|
if( out.Write(data) == -1 )
|
||||||
if( !data )
|
return false;
|
||||||
CLEANUP_AND_RETURN( false );
|
if( out.Flush() == -1 )
|
||||||
if( !in.Read(data,size) )
|
return false;
|
||||||
CLEANUP_AND_RETURN( false );
|
return true;
|
||||||
if( !out.Write(data,size) )
|
|
||||||
CLEANUP_AND_RETURN( false );
|
|
||||||
CLEANUP_AND_RETURN( true );
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user