X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8760bc6529d7e74c80ee25120274251993bc177a..aa4b42f0b79eb9fc43eec9b8a23b790ca6b00fce:/src/common/string.cpp?ds=inline diff --git a/src/common/string.cpp b/src/common/string.cpp index 9f97667da3..25e4aa3de3 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -79,7 +79,7 @@ static const struct } g_strEmpty = { {-1, 0, 0}, wxT('\0') }; // empty C style string: points to 'string data' byte of g_strEmpty -extern const wxChar WXDLLEXPORT *wxEmptyString = &g_strEmpty.dummy; +extern const wxChar WXDLLIMPEXP_BASE *wxEmptyString = &g_strEmpty.dummy; // ---------------------------------------------------------------------------- // global functions @@ -958,8 +958,13 @@ wxString wxString::AfterFirst(wxChar ch) const } // replace first (or all) occurences of some substring with another one -size_t wxString::Replace(const wxChar *szOld, const wxChar *szNew, bool bReplaceAll) +size_t +wxString::Replace(const wxChar *szOld, const wxChar *szNew, bool bReplaceAll) { + // if we tried to replace an empty string we'd enter an infinite loop below + wxCHECK_MSG( szOld && *szOld && szNew, 0, + _T("wxString::Replace(): invalid parameter") ); + size_t uiCount = 0; // count of replacements made size_t uiOldLen = wxStrlen(szOld);