#include "wx/wxprec.h"
-#ifdef __BORDLANDC__
+#ifdef __BORLANDC__
#pragma hdrstop
#endif
if (right.GetChar(0) == wxT('/')) right = right.Mid(1);
- s = new wxZipInputStream(left, right);
- if (s && (s->LastError() == wxStream_NOERROR))
+ wxFileName leftFilename = wxFileSystem::URLToFileName(left);
+
+ s = new wxZipInputStream(leftFilename.GetFullPath(), right);
+ if (s && s->IsOk() )
{
return new wxFSFile(s,
left + wxT("#zip:") + right,
}
m_ZipFile = left;
- m_Archive = (void*) unzOpen(m_ZipFile.mb_str());
+ wxString nativename = wxFileSystem::URLToFileName(m_ZipFile).GetFullPath();
+ m_Archive = (void*) unzOpen(nativename.mb_str());
m_Pattern = right.AfterLast(wxT('/'));
m_BaseDir = right.BeforeLast(wxT('/'));
while (match == wxEmptyString)
{
unzGetCurrentFileInfo((unzFile)m_Archive, NULL, namebuf, 1024, NULL, 0, NULL, 0);
- for (c = namebuf; *c; c++) if (*c == wxT('\\')) *c = wxT('/');
- namestr = namebuf;
+ for (c = namebuf; *c; c++) if (*c == '\\') *c = '/';
+ namestr = wxString::FromAscii( namebuf ); // TODO what encoding does ZIP use?
if (m_AllowDirs)
{