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:
Vadim Zeitlin
2007-01-07 22:41:39 +00:00
parent e7f84ba5b1
commit f559e6218d

View File

@@ -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
// ----------------------------------------------------------------------------