A working wcscasecmp replacement.
authorfredrik <fredrik@959494ce-11ee-0310-bf91-de5d638817bd>
Tue, 29 May 2007 17:37:43 +0000 (17:37 +0000)
committerfredrik <fredrik@959494ce-11ee-0310-bf91-de5d638817bd>
Tue, 29 May 2007 17:37:43 +0000 (17:37 +0000)
git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@1054 959494ce-11ee-0310-bf91-de5d638817bd

common/utils.c

index bb29781..6dac3dc 100644 (file)
@@ -441,11 +441,7 @@ int wcsexists(wchar_t *h, wchar_t *n)
 #ifndef HAVE_WCSCASECMP
 int wcscasecmp(const wchar_t *s1, const wchar_t *s2)
 {
-    while(towlower(*s1) == towlower(*s2))
-    {
-       if(*s1 == L'\0')
-           return(0);
-    }
+    for(; (towlower(*s1) == towlower(*s2)) && (*s1 != L'\0'); s1++, s2++);
     return(towlower(*s1) - towlower(*s2));
 }
 #endif