// check the boundary condition below
// this is more efficient than strrchr()
+ dst--;
while ( *dst != wxCONFIG_PATH_SEPARATOR )
{
dst--;
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--;
}
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