We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a158a37 commit 376bd08Copy full SHA for 376bd08
1 file changed
libretro-common/include/string/stdstring.h
@@ -117,11 +117,20 @@ static INLINE size_t strlen_size(const char *str, size_t len)
117
static INLINE bool string_is_equal_case_insensitive(const char *a,
118
const char *b)
119
{
120
- if (a == b)
121
- return true;
+ int result = 0;
+ const unsigned char *p1 = (const unsigned char*)a;
122
+ const unsigned char *p2 = (const unsigned char*)b;
123
+
124
if (!a || !b)
125
return false;
- return strcasecmp(a, b) == 0;
126
+ if (p1 == p2)
127
+ return true;
128
129
+ while ((result = tolower (*p1) - tolower (*p2++)) == 0)
130
+ if (*p1++ == '\0')
131
+ break;
132
133
+ return (result == 0);
134
}
135
136
static INLINE bool string_starts_with_case_insensitive(const char *str,
0 commit comments