fix wxConfig::DeleteGroup() for arguments with trailing slash (replaces patch 1624589)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44148 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -297,6 +297,24 @@ wxConfigPathChanger::~wxConfigPathChanger()
|
||||
}
|
||||
}
|
||||
|
||||
// this is a wxConfig method but it's mainly used with wxConfigPathChanger
|
||||
/* static */
|
||||
wxString wxConfigBase::RemoveTrailingSeparator(const wxString& key)
|
||||
{
|
||||
wxString path(key);
|
||||
|
||||
// don't remove the only separator from a root group path!
|
||||
while ( path.length() > 1 )
|
||||
{
|
||||
if ( *path.rbegin() != wxCONFIG_PATH_SEPARATOR )
|
||||
break;
|
||||
|
||||
path.erase(path.end() - 1);
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
#endif // wxUSE_CONFIG
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user