mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-02 03:47:53 +08:00
9697f95b8f
This reverts commit 15d999759e
.
26 lines
430 B
C
26 lines
430 B
C
#include <ctype.h>
|
|
|
|
#include "string_patch.h"
|
|
|
|
#ifdef HAVE_NO_STRCASESTR
|
|
char *strcasestr(char *haystack, char *needle)
|
|
{
|
|
char *p, *startn = 0, *np = 0;
|
|
|
|
for (p = haystack; *p; p++) {
|
|
if (np) {
|
|
if (toupper(*p) == toupper(*np)) {
|
|
if (!*++np)
|
|
return startn;
|
|
} else
|
|
np = 0;
|
|
} else if (toupper(*p) == toupper(*needle)) {
|
|
np = needle + 1;
|
|
startn = p;
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
#endif
|