Improve the error messages slightly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41419 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -87,6 +87,9 @@ wxFORCE_LINK_THIS_MODULE(zipstrm)
|
|||||||
//
|
//
|
||||||
static wxString ReadString(wxInputStream& stream, wxUint16 len, wxMBConv& conv)
|
static wxString ReadString(wxInputStream& stream, wxUint16 len, wxMBConv& conv)
|
||||||
{
|
{
|
||||||
|
if (len == 0)
|
||||||
|
return wxEmptyString;
|
||||||
|
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
wxCharBuffer buf(len);
|
wxCharBuffer buf(len);
|
||||||
stream.Read(buf.data(), len);
|
stream.Read(buf.data(), len);
|
||||||
@@ -758,7 +761,7 @@ wxString wxZipEntry::GetName(wxPathFormat format /*=wxPATH_NATIVE*/) const
|
|||||||
case wxPATH_DOS:
|
case wxPATH_DOS:
|
||||||
{
|
{
|
||||||
wxString name(isDir ? m_Name + _T("\\") : m_Name);
|
wxString name(isDir ? m_Name + _T("\\") : m_Name);
|
||||||
for (size_t i = name.length() - 1; i > 0; --i)
|
for (size_t i = 0; i < name.length(); i++)
|
||||||
if (name[i] == _T('/'))
|
if (name[i] == _T('/'))
|
||||||
name[i] = _T('\\');
|
name[i] = _T('\\');
|
||||||
return name;
|
return name;
|
||||||
@@ -1614,22 +1617,20 @@ wxStreamError wxZipInputStream::ReadLocal(bool readEndRec /*=false*/)
|
|||||||
return wxSTREAM_EOF;
|
return wxSTREAM_EOF;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_signature != LOCAL_MAGIC) {
|
if (m_signature == LOCAL_MAGIC) {
|
||||||
wxLogError(_("error reading zip local header"));
|
m_headerSize = m_entry.ReadLocal(*m_parent_i_stream, GetConv());
|
||||||
return wxSTREAM_READ_ERROR;
|
m_signature = 0;
|
||||||
|
m_entry.SetOffset(m_position);
|
||||||
|
m_entry.SetKey(m_position);
|
||||||
|
|
||||||
|
if (m_headerSize) {
|
||||||
|
m_TotalEntries++;
|
||||||
|
return wxSTREAM_NO_ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_headerSize = m_entry.ReadLocal(*m_parent_i_stream, GetConv());
|
wxLogError(_("error reading zip local header"));
|
||||||
m_signature = 0;
|
return wxSTREAM_READ_ERROR;
|
||||||
m_entry.SetOffset(m_position);
|
|
||||||
m_entry.SetKey(m_position);
|
|
||||||
|
|
||||||
if (!m_headerSize) {
|
|
||||||
return wxSTREAM_READ_ERROR;
|
|
||||||
} else {
|
|
||||||
m_TotalEntries++;
|
|
||||||
return wxSTREAM_NO_ERROR;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxUint32 wxZipInputStream::ReadSignature()
|
wxUint32 wxZipInputStream::ReadSignature()
|
||||||
|
Reference in New Issue
Block a user