Make Eof() consistent with other streams

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36298 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Michael Wetherell
2005-11-30 12:41:48 +00:00
parent 4d53859584
commit 8e50d1add6
4 changed files with 10 additions and 14 deletions

View File

@@ -131,14 +131,16 @@ size_t wxZlibInputStream::OnSysRead(void *buffer, size_t size)
break;
case Z_STREAM_END:
// Unread any data taken from past the end of the deflate stream, so that
// any additional data can be read from the underlying stream (the crc
// in a gzip for example)
if (m_inflate->avail_in) {
m_parent_i_stream->Ungetch(m_inflate->next_in, m_inflate->avail_in);
m_inflate->avail_in = 0;
if (m_inflate->avail_out) {
// Unread any data taken from past the end of the deflate stream, so that
// any additional data can be read from the underlying stream (the crc
// in a gzip for example)
if (m_inflate->avail_in) {
m_parent_i_stream->Ungetch(m_inflate->next_in, m_inflate->avail_in);
m_inflate->avail_in = 0;
}
m_lasterror = wxSTREAM_EOF;
}
m_lasterror = wxSTREAM_EOF;
break;
case Z_BUF_ERROR: