Move some string functions from core to logic (bug 4406 part 4, r=fyren).

This commit is contained in:
David Anderson
2010-05-14 19:28:10 -07:00
parent b5b002aa4b
commit 1cdacf69be
12 changed files with 128 additions and 44 deletions
-31
View File
@@ -1274,37 +1274,6 @@ done:
return (maxlen - llen - 1);
}
const char *stristr(const char *str, const char *substr)
{
if (!*substr)
{
return ((char *)str);
}
char *needle = (char *)substr;
char *prevloc = (char *)str;
char *haystack = (char *)str;
while (*haystack)
{
if (tolower(*haystack) == tolower(*needle))
{
haystack++;
if (!*++needle)
{
return prevloc;
}
}
else
{
haystack = ++prevloc;
needle = (char *)substr;
}
}
return NULL;
}
unsigned int strncopy(char *dest, const char *src, size_t count)
{
if (!count)