Skip to content

Commit

Permalink
ignorecase.c: use PHYSFS_utf8stricmp() now.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Aug 11, 2017
1 parent d1f2637 commit 15048fb
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions extras/ignorecase.c
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 15048fb

Please sign in to comment.