4 char *gitstrcasestr(const char *haystack, const char *needle)
6 int nlen = strlen(needle);
7 int hlen = strlen(haystack) - nlen + 1;
10 for (i = 0; i < hlen; i++) {
12 for (j = 0; j < nlen; j++) {
13 unsigned char c1 = haystack[i+j];
14 unsigned char c2 = needle[j];
15 if (toupper(c1) != toupper(c2))
18 return (char *) haystack + i;