Răsfoiți Sursa

unicode: Minor tweak to PHYSFS_caseFold.

We assign `*to = from` at the end of the function, so only return early
from the low-ASCII case if we actual did a conversion.

(cherry picked from commit 5874d1b328315e737c18a68dfe9bb5cec2fed85d)
Ryan C. Gordon 1 an în urmă
părinte
comite
4d4cf67b0c
1 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  1. 3 3
      src/physfs_unicode.c

+ 3 - 3
src/physfs_unicode.c

@@ -442,10 +442,10 @@ int PHYSFS_caseFold(const PHYSFS_uint32 from, PHYSFS_uint32 *to)
     if (from < 128)  /* low-ASCII, easy! */
     {
         if ((from >= 'A') && (from <= 'Z'))
+        {
             *to = from - ('A' - 'a');
-        else
-            *to = from;
-        return 1;
+            return 1;
+        } /* if */
     } /* if */
 
     else if (from <= 0xFFFF)