]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/zstream.cpp
added wxMBConv::Clone() to be able to copy conversion objects polymorphically
[wxWidgets.git] / src / common / zstream.cpp
index 083ac372fbad895ecd1f120cb4e7a8b1607ed1a6..0b4878cf9182594e327361b924a7d775f6e8af01 100644 (file)
@@ -136,6 +136,7 @@ size_t wxZlibInputStream::OnSysRead(void *buffer, size_t size)
         // any additional data can be read from the underlying stream (the crc
         // in a gzip for example)
         if (m_inflate->avail_in) {
         // 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->Reset();
           m_parent_i_stream->Ungetch(m_inflate->next_in, m_inflate->avail_in);
           m_inflate->avail_in = 0;
         }
           m_parent_i_stream->Ungetch(m_inflate->next_in, m_inflate->avail_in);
           m_inflate->avail_in = 0;
         }
@@ -282,7 +283,11 @@ size_t wxZlibOutputStream::OnSysWrite(const void *buffer, size_t size)
   wxASSERT_MSG(m_deflate && m_z_buffer, wxT("Deflate stream not open"));
 
   if (!m_deflate || !m_z_buffer)
   wxASSERT_MSG(m_deflate && m_z_buffer, wxT("Deflate stream not open"));
 
   if (!m_deflate || !m_z_buffer)
+  {
+    // notice that this will make IsOk() test just below return false
     m_lasterror = wxSTREAM_WRITE_ERROR;
     m_lasterror = wxSTREAM_WRITE_ERROR;
+  }
+
   if (!IsOk() || !size)
     return 0;
 
   if (!IsOk() || !size)
     return 0;