Seek(-1, mode) should work instead of giving an error if mode != wxFromStart
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32937 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
d0eba44dcb
commit
686a3ee080
@ -13,6 +13,7 @@ All:
|
||||
- Added wxTempFileOutputStream by Stas Sergeev.
|
||||
- Fixed wxDateTime::SetToWeekDayInSameWeek(Sun, Monday_First).
|
||||
- Added WXK_SPECIAL keycodes for special hardware buttons.
|
||||
- Fixed bug with wxFile::Seek(-1, wxFromCurrent)
|
||||
|
||||
All (GUI):
|
||||
|
||||
|
@ -356,7 +356,10 @@ bool wxFile::Flush()
|
||||
// seek
|
||||
wxFileOffset wxFile::Seek(wxFileOffset ofs, wxSeekMode mode)
|
||||
{
|
||||
wxASSERT( IsOpened() );
|
||||
wxASSERT_MSG( IsOpened(), _T("can't seek on closed file") );
|
||||
wxCHECK_MSG( ofs != wxInvalidOffset || mode != wxFromStart,
|
||||
wxInvalidOffset,
|
||||
_T("invalid absolute file offset") );
|
||||
|
||||
int origin;
|
||||
switch ( mode ) {
|
||||
@ -376,11 +379,6 @@ wxFileOffset wxFile::Seek(wxFileOffset ofs, wxSeekMode mode)
|
||||
break;
|
||||
}
|
||||
|
||||
if (ofs == wxInvalidOffset)
|
||||
{
|
||||
wxLogSysError(_("can't seek on file descriptor %d, large files support is not enabled."), m_fd);
|
||||
return wxInvalidOffset;
|
||||
}
|
||||
wxFileOffset iRc = wxSeek(m_fd, ofs, origin);
|
||||
if ( iRc == wxInvalidOffset )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user