Fix wxZipFSHandler behaviour when used with relative filenames with ..

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@23721 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2003-09-19 21:51:44 +00:00
parent e0ea65c81b
commit ce720741f0

View File

@@ -39,9 +39,9 @@
#endif
//--------------------------------------------------------------------------------
//----------------------------------------------------------------------------
// wxZipFSHandler
//--------------------------------------------------------------------------------
//----------------------------------------------------------------------------
@@ -87,6 +87,14 @@ wxFSFile* wxZipFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& l
return NULL;
}
if (right.Contains(wxT("./")))
{
if (right.GetChar(0) != wxT('/')) right = wxT('/') + right;
wxFileName rightPart(right, wxPATH_UNIX);
rightPart.Normalize(wxPATH_NORM_DOTS, wxT("/"), wxPATH_UNIX);
right = rightPart.GetFullPath(wxPATH_UNIX);
}
if (right.GetChar(0) == wxT('/')) right = right.Mid(1);
wxFileName leftFilename = wxFileSystem::URLToFileName(left);