correct the bug with Replace()ing with empty string introduced by r54860 (re-fixes #9802)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@55034 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1503,7 +1503,7 @@ wxString::Replace(const wxChar *szOld, const wxChar *szNew, bool bReplaceAll)
|
|||||||
|
|
||||||
// optimize the special common case of replacing one character with another
|
// optimize the special common case of replacing one character with another
|
||||||
// one
|
// one
|
||||||
if ( szOld[1] == '\0' && szNew[1] == '\0' )
|
if ( szOld[1] == '\0' && (szNew[0] != '\0' && szNew[1] == '\0') )
|
||||||
{
|
{
|
||||||
// this loop is the simplified version of the one below
|
// this loop is the simplified version of the one below
|
||||||
for ( size_t pos = 0; ; )
|
for ( size_t pos = 0; ; )
|
||||||
|
Reference in New Issue
Block a user