Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/compat/strcasestr.c # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / compat / strcasestr.c` 22 lines ยท 431 bytes Raw Blame History 1 #include "../git-compat-util.h" 2 3 char *gitstrcasestr(const char *haystack, const char *needle) 4 { 5 int nlen = strlen(needle); 6 int hlen = strlen(haystack) - nlen + 1; 7 int i; 8 9 for (i = 0; i < hlen; i++) { 10 int j; 11 for (j = 0; j < nlen; j++) { 12 unsigned char c1 = haystack[i+j]; 13 unsigned char c2 = needle[j]; 14 if (toupper(c1) != toupper(c2)) 15 goto next; 16 } 17 return (char *) haystack + i; 18 next: 19 ; 20 } 21 return NULL; 22 }