summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2004-04-22 18:12:22 +0000
committerSimon Tatham <anakin@pobox.com>2004-04-22 18:12:22 +0000
commitfb251259853bfc795ea5db1a0e9393e1f5c4fbc1 (patch)
treee57685ce5cb3e0f570475380a252d4e601d4c860
parent696363c8dd1637fda63d45f98b4474803bba87b3 (diff)
downloadhalibut-fb251259853bfc795ea5db1a0e9393e1f5c4fbc1.zip
halibut-fb251259853bfc795ea5db1a0e9393e1f5c4fbc1.tar.gz
halibut-fb251259853bfc795ea5db1a0e9393e1f5c4fbc1.tar.bz2
halibut-fb251259853bfc795ea5db1a0e9393e1f5c4fbc1.tar.xz
Use iswalpha and towlower if they're available.
[originally from svn r4118]
-rw-r--r--ustring.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ustring.c b/ustring.c
index 1980a95..50c02d4 100644
--- 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) {