1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-16 00:42:45 +01:00

Codechange: Replace strcasestr with StrContainsIgnoreCase.

This commit is contained in:
frosch
2025-04-04 21:42:45 +02:00
committed by frosch
parent 14bab7d76b
commit 9229956f04
4 changed files with 7 additions and 32 deletions

View File

@@ -470,22 +470,6 @@ size_t Utf8Decode(char32_t *c, const char *s)
return 1;
}
#ifdef DEFINE_STRCASESTR
char *strcasestr(const char *haystack, const char *needle)
{
size_t hay_len = strlen(haystack);
size_t needle_len = strlen(needle);
while (hay_len >= needle_len) {
if (strncasecmp(haystack, needle, needle_len) == 0) return const_cast<char *>(haystack);
haystack++;
hay_len--;
}
return nullptr;
}
#endif /* DEFINE_STRCASESTR */
/**
* Test if a unicode character is considered garbage to be skipped.
* @param c Character to test.