From: Julian Smart Date: Sun, 28 Mar 2004 13:52:42 +0000 (+0000) Subject: Corrected wxFileSystemHandler::GetRightLocation for the case X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8b0d53975d0d1c973b5392e035974cb37975a138 Corrected wxFileSystemHandler::GetRightLocation for the case where a DOS drive is specified. Otherwise, the value returned for e.g. file://c:\temp\thing.txt is \temp\thing.txt, because the test for twos colon doesn't handle this case. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26424 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/filesys.cpp b/src/common/filesys.cpp index 5e10fd8d44..8fab430376 100644 --- a/src/common/filesys.cpp +++ b/src/common/filesys.cpp @@ -157,11 +157,24 @@ wxString wxFileSystemHandler::GetRightLocation(const wxString& location) const for (i = l-1; (i >= 0) && - ((location[i] != wxT(':')) || (i == 1) || (location[i-2] == wxT(':'))); + ((location[i] != wxT(':')) || (i == 1) || + (location[i-2] == wxT(':')) +#ifdef __WXMSW__ + || ((i > 3) && location[i-4] == wxT(':')) // E.g. file://C:/thing.jpg +#endif + ); i--) { if (location[i] == wxT('#')) l2 = i + 1; } +#ifdef __WXMSW__ + // We may now have //c:/thing.jpg + if (((i + 4) < l) && location[i+1] == wxT('/') && location[i+2] == wxT('/') && + location[i+4] == wxT(':')) + { + i = i + 2; + } +#endif if (i == 0) return wxEmptyString; else return location.Mid(i + 1, l2 - i - 2); }