From eaafc5e9723f0ff4c03dbe2facd38093cf388136 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 Aug 2008 20:34:36 +0000 Subject: [PATCH] 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 --- src/common/string.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/string.cpp b/src/common/string.cpp index 06f7e5298a..7556a54396 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -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 // 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 for ( size_t pos = 0; ; )