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:
@@ -39,9 +39,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// wxZipFSHandler
|
// wxZipFSHandler
|
||||||
//--------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -87,6 +87,14 @@ wxFSFile* wxZipFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& l
|
|||||||
return NULL;
|
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);
|
if (right.GetChar(0) == wxT('/')) right = right.Mid(1);
|
||||||
|
|
||||||
wxFileName leftFilename = wxFileSystem::URLToFileName(left);
|
wxFileName leftFilename = wxFileSystem::URLToFileName(left);
|
||||||
|
Reference in New Issue
Block a user