X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f3558accb076d310af4590fdd8382892d5c3c653..644231539d2ccf9ef873060154079f33ba7a42db:/src/msw/dirdlg.cpp diff --git a/src/msw/dirdlg.cpp b/src/msw/dirdlg.cpp index 0b8885ffd9..63194ca403 100644 --- a/src/msw/dirdlg.cpp +++ b/src/msw/dirdlg.cpp @@ -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('\\'); } } }