extras/ignorecase.c
changeset 1638 1cbecbcf537e
parent 1631 1aec60db9326
equal deleted inserted replaced
1635:f50073f63720 1638:1cbecbcf537e
    48         rc = PHYSFS_enumerateFiles(buf);
    48         rc = PHYSFS_enumerateFiles(buf);
    49         *ptr = '/';
    49         *ptr = '/';
    50         ptr++;  /* point past dirsep to entry itself. */
    50         ptr++;  /* point past dirsep to entry itself. */
    51     } /* else */
    51     } /* else */
    52 
    52 
    53     for (i = rc; *i != NULL; i++)
    53     if (rc != NULL)
    54     {
    54     {
    55         if (PHYSFS_utf8stricmp(*i, ptr) == 0)
    55         for (i = rc; *i != NULL; i++)
    56         {
    56         {
    57             strcpy(ptr, *i); /* found a match. Overwrite with this case. */
    57             if (PHYSFS_utf8stricmp(*i, ptr) == 0)
    58             PHYSFS_freeList(rc);
    58             {
    59             return 1;
    59                 strcpy(ptr, *i); /* found a match. Overwrite with this case. */
    60         } /* if */
    60                 PHYSFS_freeList(rc);
    61     } /* for */
    61                 return 1;
       
    62             } /* if */
       
    63         } /* for */
       
    64 
       
    65         PHYSFS_freeList(rc);
       
    66     } /* if */
    62 
    67 
    63     /* no match at all... */
    68     /* no match at all... */
    64     PHYSFS_freeList(rc);
       
    65     return 0;
    69     return 0;
    66 } /* locateOneElement */
    70 } /* locateOneElement */
    67 
    71 
    68 
    72 
    69 int PHYSFSEXT_locateCorrectCase(char *buf)
    73 int PHYSFSEXT_locateCorrectCase(char *buf)