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.
|
- Added wxTempFileOutputStream by Stas Sergeev.
|
||||||
- Fixed wxDateTime::SetToWeekDayInSameWeek(Sun, Monday_First).
|
- Fixed wxDateTime::SetToWeekDayInSameWeek(Sun, Monday_First).
|
||||||
- Added WXK_SPECIAL keycodes for special hardware buttons.
|
- Added WXK_SPECIAL keycodes for special hardware buttons.
|
||||||
|
- Fixed bug with wxFile::Seek(-1, wxFromCurrent)
|
||||||
|
|
||||||
All (GUI):
|
All (GUI):
|
||||||
|
|
||||||
|
@ -356,7 +356,10 @@ bool wxFile::Flush()
|
|||||||
// seek
|
// seek
|
||||||
wxFileOffset wxFile::Seek(wxFileOffset ofs, wxSeekMode mode)
|
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;
|
int origin;
|
||||||
switch ( mode ) {
|
switch ( mode ) {
|
||||||
@ -376,11 +379,6 @@ wxFileOffset wxFile::Seek(wxFileOffset ofs, wxSeekMode mode)
|
|||||||
break;
|
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);
|
wxFileOffset iRc = wxSeek(m_fd, ofs, origin);
|
||||||
if ( iRc == wxInvalidOffset )
|
if ( iRc == wxInvalidOffset )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user