From 15048fbb1d6e2cf78a6a249c6141e3df75d08412 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 11 Aug 2017 01:39:58 -0400 Subject: [PATCH] ignorecase.c: use PHYSFS_utf8stricmp() now. --- extras/ignorecase.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/extras/ignorecase.c b/extras/ignorecase.c index b2322841..3a58f1bd 100644 --- a/extras/ignorecase.c +++ b/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);