X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e87b78335291c67025c5a763c2acfb22343f9908..adb4816c3eb825108e8e94ef523a5da666111430:/src/common/string.cpp diff --git a/src/common/string.cpp b/src/common/string.cpp index 995433e317..2bd4e6178f 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -9,7 +9,7 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "string.h" #endif @@ -468,8 +468,6 @@ size_t wxStringBase::find(const wxChar* sz, size_t nStart, size_t n) const return find(wxStringBase(sz, n), nStart); } -// Gives a duplicate symbol (presumably a case-insensitivity problem) -#if !defined(__BORLANDC__) size_t wxStringBase::find(wxChar ch, size_t nStart) const { wxASSERT( nStart <= length() ); @@ -478,7 +476,6 @@ size_t wxStringBase::find(wxChar ch, size_t nStart) const return p == NULL ? npos : p - c_str(); } -#endif size_t wxStringBase::rfind(const wxStringBase& str, size_t nStart) const { @@ -539,10 +536,11 @@ size_t wxStringBase::find_last_of(const wxChar* sz, size_t nStart) const } else { - wxASSERT( nStart <= length() ); + wxASSERT_MSG( nStart <= length(), + _T("invalid index in find_last_of()") ); } - for ( const wxChar *p = c_str() + length() - 1; p >= c_str(); p-- ) + for ( const wxChar *p = c_str() + nStart - 1; p >= c_str(); p-- ) { if ( wxStrchr(sz, *p) ) return p - c_str();