fixed bug in wxStrstr() replacement implementation (part of patch 565031)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15784 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -285,12 +285,20 @@ WXDLLEXPORT size_t wxStrspn(const wxChar *s, const wxChar *accept)
|
|||||||
|
|
||||||
WXDLLEXPORT wxChar * wxStrstr(const wxChar *haystack, const wxChar *needle)
|
WXDLLEXPORT wxChar * wxStrstr(const wxChar *haystack, const wxChar *needle)
|
||||||
{
|
{
|
||||||
wxChar *fnd;
|
wxCHECK_RET( needle, NULL, _T("NULL argument in wxStrstr") );
|
||||||
while ((fnd = wxStrchr(haystack, *needle))) {
|
|
||||||
if (!wxStrcmp(fnd, needle)) return fnd;
|
const size_t len = wxStrlen(needle);
|
||||||
haystack = fnd + 1;
|
|
||||||
}
|
wxChar *fnd;
|
||||||
return (wxChar *)NULL;
|
while ( (fnd = wxStrchr(haystack, *needle)) )
|
||||||
|
{
|
||||||
|
if ( !wxStrncmp(fnd, needle, len) )
|
||||||
|
return fnd;
|
||||||
|
|
||||||
|
haystack = fnd + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (wxChar *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
WXDLLEXPORT double wxStrtod(const wxChar *nptr, wxChar **endptr)
|
WXDLLEXPORT double wxStrtod(const wxChar *nptr, wxChar **endptr)
|
||||||
|
Reference in New Issue
Block a user