]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dirdlg.cpp
Corrected wrong use of delete in region code.
[wxWidgets.git] / src / msw / dirdlg.cpp
index 0b8885ffd9143af080111b86f4a9bf2f9d305ba5..63194ca403c8114f82eb2d051d745213a03c9e65 100644 (file)
@@ -81,7 +81,9 @@ wxDirDialog::wxDirDialog(wxWindow *parent,
                          const wxString& message,
                          const wxString& defaultPath,
                          long WXUNUSED(style),
-                         const wxPoint& WXUNUSED(pos))
+                         const wxPoint& WXUNUSED(pos),
+                         const wxSize& WXUNUSED(size),
+                         const wxString& WXUNUSED(name))
 {
     m_message = message;
     m_parent = parent;
@@ -99,14 +101,14 @@ void wxDirDialog::SetPath(const wxString& path)
     {
         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('\\');
         }
     }
 }