fixed bug in AssignDir() which didn't always consider the argument as directory

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12843 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-12-03 18:28:07 +00:00
parent 1dc302a8ae
commit 9bbe7068c4

View File

@@ -257,7 +257,14 @@ void wxFileName::Assign(const wxString& fullpath,
void wxFileName::AssignDir(const wxString& dir, wxPathFormat format)
{
Assign(dir, _T(""), format);
// always recognize dir as directory, even if it doesn't end with a slash
wxString dirname = dir;
if ( !wxEndsWithPathSeparator(dirname) )
{
dirname += GetPathSeparators(format)[0u];
}
Assign(dirname, _T(""), format);
}
void wxFileName::Clear()