git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14973 
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
     {
         while ( *(m_path.end() - 1) == _T('\\') )
         {
-            size_t len = m_path.length();
-            if ( len == 1 )
-            {
-                // leave '/' alone
-                break;
-            }
+            m_path.erase(m_path.length() - 1);
+        }
 
-            m_path.erase(len - 1);
+        // but the root drive should have a trailing slash (again, this is just
+        // the way the native dialog works)
+        if ( *(m_path.end() - 1) == _T(':') )
+        {
+            m_path += _T('\\');
         }
     }
 }