X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f8fbc92bdb84f34fc7306266b116ebd2da28c950..64f9c1009476cd0a347d6c3dfc93993652cbd199:/src/common/zipstrm.cpp diff --git a/src/common/zipstrm.cpp b/src/common/zipstrm.cpp index 4aa752940c..f9f9826428 100644 --- a/src/common/zipstrm.cpp +++ b/src/common/zipstrm.cpp @@ -34,7 +34,6 @@ #include "wx/buffer.h" #include "wx/ptr_scpd.h" #include "wx/wfstream.h" -#include "wx/html/forcelnk.h" #include "zlib.h" // value for the 'version needed to extract' field (20 means 2.0) @@ -82,7 +81,12 @@ enum { IMPLEMENT_DYNAMIC_CLASS(wxZipEntry, wxArchiveEntry) IMPLEMENT_DYNAMIC_CLASS(wxZipClassFactory, wxArchiveClassFactory) -FORCE_LINK_ME(zipstrm) +//FORCE_LINK_ME(zipstrm) +int _wx_link_dummy_func_zipstrm(); +int _wx_link_dummy_func_zipstrm() +{ + return 1; +} ///////////////////////////////////////////////////////////////////////////// @@ -1351,6 +1355,9 @@ bool wxZipInputStream::LoadEndRecord() // bool wxZipInputStream::FindEndRecord() { + if (!m_parent_i_stream->IsSeekable()) + return false; + // usually it's 22 bytes in size and the last thing in the file { wxLogNull nolog; @@ -1917,7 +1924,7 @@ bool wxZipOutputStream::DoCreate(wxZipEntry *entry, bool raw /*=false*/) ds << LOCAL_MAGIC; // and if this is the first entry test for seekability - if (m_headerOffset == 0) { + if (m_headerOffset == 0 && m_parent_o_stream->IsSeekable()) { bool logging = wxLog::IsEnabled(); wxLogNull nolog; wxFileOffset here = m_parent_o_stream->TellO();