Skip to content
Permalink
Browse files
ignorecase.c: use PHYSFS_utf8stricmp() now.
  • Loading branch information
icculus committed Aug 11, 2017
1 parent d1f2637 commit 15048fbb1d6e2cf78a6a249c6141e3df75d08412
Showing with 1 addition and 20 deletions.
  1. +1 −20 extras/ignorecase.c
@@ -27,25 +27,6 @@
* \author Ryan C. Gordon.
*/

/* I'm not screwing around with stricmp vs. strcasecmp... */
/* !!! FIXME-3.0: this will NOT work with UTF-8 strings in physfs2.0 */
static int caseInsensitiveStringCompare(const char *x, const char *y)
{
int ux, uy;
do
{
ux = toupper((int) *x);
uy = toupper((int) *y);
if (ux != uy)
return ((ux > uy) ? 1 : -1);
x++;
y++;
} while ((ux) && (uy));

return 0;
} /* caseInsensitiveStringCompare */


static int locateOneElement(char *buf)
{
char *ptr;
@@ -71,7 +52,7 @@ static int locateOneElement(char *buf)

for (i = rc; *i != NULL; i++)
{
if (caseInsensitiveStringCompare(*i, ptr) == 0)
if (PHYSFS_utf8stricmp(*i, ptr) == 0)
{
strcpy(ptr, *i); /* found a match. Overwrite with this case. */
PHYSFS_freeList(rc);

0 comments on commit 15048fb

Please sign in to comment.