X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/442d08ce743780b40895848a7d07c083e327aa2f..a111f2b216a90bacb254644d3cae526eddc9f9f1:/src/msw/regconf.cpp diff --git a/src/msw/regconf.cpp b/src/msw/regconf.cpp index 5d8d70f97a..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--; } @@ -309,8 +313,12 @@ void wxRegConfig::SetPath(const wxString& strPath) totalSlashes++; } - //else: nothing to do, we squeeze several subseuquent - // slashes into one + else // previous char was a slash too + { + // squeeze several subsequent slashes into one: i.e. + // just ignore this one + dst--; + } } } else // normal character