]> git.saurik.com Git - wxWidgets.git/commitdiff
Ignore DOS drive spec in GetRightLocation
authorJulian Smart <julian@anthemion.co.uk>
Tue, 10 Dec 2002 09:48:00 +0000 (09:48 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 10 Dec 2002 09:48:00 +0000 (09:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18174 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/filesys.cpp

index 781dc5c909347397bbc6caee9e75c935517e3b6b..e646253301ad02413ec6fa7bb54d15cff6f0444c 100644 (file)
@@ -127,7 +127,16 @@ wxString wxFileSystemHandler::GetRightLocation(const wxString& location) const
 {
     int i, l = location.Length();
     int l2 = l + 1;
-    for (i = l-1; (i >= 0) && ((location[i] != wxT(':')) || (i == 1) || (location[i-2] == wxT(':'))); i--) {if (location[i] == wxT('#')) l2 = i + 1;}
+//    for (i = l-1; (i >= 0) && ((location[i] != wxT(':')) || (i == 1) || (location[i-2] == wxT(':'))); i--)
+    for (i = l-1;
+        (i >= 0) &&
+            (((location[i] != wxT(':')) || ((i >= 2) && (location[i-2] == wxT('/')))) || // Ignore e.g. /c:/ component
+            (i == 1) ||
+            (location[i-2] == wxT(':'))
+            ); i--)
+    {
+        if (location[i] == wxT('#')) l2 = i + 1;
+    }
     if (i == 0) return wxEmptyString;
     else return location.Mid(i + 1, l2 - i - 2);
 }