From: Vadim Zeitlin Date: Mon, 3 Dec 2001 18:28:07 +0000 (+0000) Subject: fixed bug in AssignDir() which didn't always consider the argument as directory X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9bbe7068c4cdeecaf2493385a589e14d43820dcf 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 --- diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 221ebb8176..b4be3a2eaa 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -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()