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