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:
Vadim Zeitlin 2005-03-20 18:48:58 +00:00
parent d0eba44dcb
commit 686a3ee080
2 changed files with 5 additions and 6 deletions

View File

@ -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):

View File

@ -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 )
{