From: Vadim Zeitlin Date: Sat, 22 Sep 2001 23:23:04 +0000 (+0000) Subject: fixed yet another bug in wxRegConfig::SetPath() - SetPath(../..) didn't work X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/79c3b7b216a5fc6b105acb49690e5b4e626080e2 fixed yet another bug in wxRegConfig::SetPath() - SetPath(../..) didn't work git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11673 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/regconf.cpp b/src/msw/regconf.cpp index 2fa8685006..07fcf8201b 100644 --- a/src/msw/regconf.cpp +++ b/src/msw/regconf.cpp @@ -274,6 +274,7 @@ void wxRegConfig::SetPath(const wxString& strPath) // check the boundary condition below // this is more efficient than strrchr() + dst--; while ( *dst != wxCONFIG_PATH_SEPARATOR ) { dst--; @@ -288,10 +289,13 @@ void wxRegConfig::SetPath(const wxString& strPath) posLastSlash = -1; } - // this shouldn't happen + // we must have found a slash one way or another! wxASSERT_MSG( *dst == wxCONFIG_PATH_SEPARATOR, _T("error in wxRegConfig::SetPath") ); + // stay at the same position + dst--; + // we killed one totalSlashes--; }