From 19a2deddc5d218ac59b6f99ff959f586462e3220 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 13 Nov 2001 18:50:05 +0000 Subject: [PATCH] fixed bugs in rfind() (patch 481325) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12404 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/string.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/string.cpp b/src/common/string.cpp index 680cc70c2b..7a30eb68ce 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -1698,7 +1698,7 @@ size_t wxString::find(wxChar ch, size_t nStart) const size_t wxString::rfind(const wxString& str, size_t nStart) const { wxASSERT( str.GetStringData()->IsValid() ); - wxASSERT( nStart <= Len() ); + wxASSERT( nStart == npos || nStart <= Len() ); // TODO could be made much quicker than that const wxChar *p = c_str() + (nStart == npos ? Len() : nStart); @@ -1715,7 +1715,7 @@ size_t wxString::rfind(const wxString& str, size_t nStart) const #if !defined(__VISUALC__) || defined(__WIN32__) size_t wxString::rfind(const wxChar* sz, size_t nStart, size_t n) const { - return rfind(wxString(sz, n == npos ? 0 : n), nStart); + return rfind(wxString(sz, n == npos ? wxSTRING_MAXLEN : n), nStart); } size_t wxString::rfind(wxChar ch, size_t nStart) const -- 2.45.2