platform/posix.c
changeset 596 381b6ca0dd85
parent 558 a62e8e26dfc9
child 644 1cb5533d369c
child 940 a624957f6288
--- a/platform/posix.c	Sat Sep 13 02:30:55 2003 +0000
+++ b/platform/posix.c	Sun Nov 09 20:59:07 2003 +0000
@@ -141,6 +141,28 @@
 } /* __PHYSFS_platformStricmp */
 
 
+int __PHYSFS_platformStrnicmp(const char *x, const char *y, PHYSFS_uint32 len)
+{
+    int ux, uy;
+
+    if (!len)
+        return(0);
+
+    do
+    {
+        ux = toupper((int) *x);
+        uy = toupper((int) *y);
+        if (ux != uy)
+            return((ux > uy) ? 1 : -1);
+        x++;
+        y++;
+        len--;
+    } while ((ux) && (uy) && (len));
+
+    return(0);
+} /* __PHYSFS_platformStrnicmp */
+
+
 #if (defined __PHYSFS_NO_SYMLINKS__)
 #define doStat stat
 #else