fixed bug with initial path being a root directory on the drive

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14973 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-04-06 20:54:42 +00:00
parent 232f35cba7
commit da03e3303f

View File

@@ -99,14 +99,14 @@ void wxDirDialog::SetPath(const wxString& path)
{ {
while ( *(m_path.end() - 1) == _T('\\') ) while ( *(m_path.end() - 1) == _T('\\') )
{ {
size_t len = m_path.length(); m_path.erase(m_path.length() - 1);
if ( len == 1 ) }
{
// leave '/' alone
break;
}
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('\\');
} }
} }
} }