MCPcopy Create free account
hub / github.com/cgsecurity/testdisk / strcasestr

Function strcasestr

src/common.c:157–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155
156#ifndef HAVE_STRCASESTR
157char * strcasestr (const char *haystack, const char *needle)
158{
159 const char *p, *startn = NULL, *np = NULL;
160 for (p = haystack; *p; p++)
161 {
162 if (np)
163 {
164 if (toupper(*p) == toupper(*np))
165 {
166 if (!*++np)
167 return startn;
168 }
169 else
170 np = NULL;
171 }
172 else if (toupper(*p) == toupper(*needle))
173 {
174 np = needle + 1;
175 startn = p;
176 }
177 }
178 return NULL;
179}
180#endif
181
182#if ! defined(HAVE_LOCALTIME_R) && ! defined(__MINGW32__) && !defined(DISABLED_FOR_FRAMAC)

Callers 2

dir_aff_ncursesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected