Use iswalpha and towlower if they're available.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 22 Apr 2004 18:12:22 +0000 (18:12 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 22 Apr 2004 18:12:22 +0000 (18:12 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/halibut@4118 cda61777-01e9-0310-a592-d414129be87e

ustring.c

index 1980a95..50c02d4 100644 (file)
--- a/ustring.c
+++ b/ustring.c
@@ -262,15 +262,21 @@ int ustrcmp(wchar_t *lhs, wchar_t *rhs) {
 wchar_t utolower(wchar_t c) {
     if (c == L'\0')
        return c;                      /* this property needed by ustricmp */
-    /* FIXME: this doesn't even come close */
+#ifdef HAS_TOWLOWER
+    return towlower(c);
+#else
     if (c >= 'A' && c <= 'Z')
        c += 'a'-'A';
     return c;
+#endif
 }
 
 int uisalpha(wchar_t c) {
-    /* FIXME: this doesn't even come close */
+#ifdef HAS_ISWALPHA
+    return iswalpha(c);
+#else
     return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z');
+#endif
 }
 
 int ustricmp(wchar_t *lhs, wchar_t *rhs) {