fix copied filepos
This commit is contained in:
@@ -66,14 +66,17 @@ RageFile::RageFile( const CString& path, RageFile::OpenMode mode )
|
|||||||
|
|
||||||
RageFile::RageFile( const RageFile &cpy )
|
RageFile::RageFile( const RageFile &cpy )
|
||||||
{
|
{
|
||||||
|
ResetBuf();
|
||||||
|
|
||||||
|
/* This will copy the file driver, including its internal file pointer. */
|
||||||
m_File = cpy.m_File->Copy( *this );
|
m_File = cpy.m_File->Copy( *this );
|
||||||
m_Path = cpy.m_Path;
|
m_Path = cpy.m_Path;
|
||||||
m_Mode = cpy.m_Mode;
|
m_Mode = cpy.m_Mode;
|
||||||
m_Error = cpy.m_Error;
|
m_Error = cpy.m_Error;
|
||||||
m_EOF = cpy.m_EOF;
|
m_EOF = cpy.m_EOF;
|
||||||
m_FilePos = cpy.m_FilePos;
|
m_FilePos = cpy.m_FilePos;
|
||||||
|
memcpy( this->m_Buffer, cpy.m_Buffer, cpy.m_BufUsed );
|
||||||
ResetBuf();
|
m_BufUsed = cpy.m_BufUsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
CString RageFile::GetPath() const
|
CString RageFile::GetPath() const
|
||||||
|
|||||||
@@ -246,6 +246,8 @@ RageFileObj *RageFileObjDirect::Copy( RageFile &p ) const
|
|||||||
if( ret == NULL )
|
if( ret == NULL )
|
||||||
RageException::Throw("Couldn't reopen \"%s\": %s", path.c_str(), strerror(err) );
|
RageException::Throw("Couldn't reopen \"%s\": %s", path.c_str(), strerror(err) );
|
||||||
|
|
||||||
|
ret->Seek( parent.Tell() );
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user