haiku/src/kits/support/string_helper.cpp
Stefano Ceccherini 53fd1e70a4 More BString functions. Constructors, CountChars() and operators "=" and "+=" are tested with cppunit and work fine.
Added string_helper.cpp and .h to compile String.cpp correctly. Those will be removed as soon as we have our working libc.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1313 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-30 06:59:26 +00:00

27 lines
495 B
C++

//Those functions are here just to compile BString.
//They will be removed as soon as our libc compiles.
#include <ctype.h>
#include <string.h>
char *
strcasestr(const char *s, const char *find)
{
char c, sc;
size_t len;
if ((c = *find++) != 0) {
c = tolower((unsigned char)c);
len = strlen(find);
do {
do {
if ((sc = *s++) == 0)
return NULL;
} while ((char)tolower((unsigned char)sc) != c);
} while (strncasecmp(s, find, len) != 0);
s--;
}
return (char *)s;
}