+ if (m_inflate->avail_in == 0) {
+ if (m_parent_i_stream->Eof())
+ wxLogError(_("Can't read inflate stream: unexpected EOF in underlying stream."));
+ m_lasterror = wxSTREAM_READ_ERROR;
+ break;
+ }
+ }
+ err = inflate(m_inflate, Z_NO_FLUSH);
+ }
+
+ if (err == 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;