From: fredrik Date: Tue, 29 May 2007 17:37:43 +0000 (+0000) Subject: A working wcscasecmp replacement. X-Git-Tag: 0.4~24 X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=2b1082a68ac83c5a1e031998ae84c2a33d9245be;p=doldaconnect.git A working wcscasecmp replacement. git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@1054 959494ce-11ee-0310-bf91-de5d638817bd --- diff --git a/common/utils.c b/common/utils.c index bb29781..6dac3dc 100644 --- a/common/utils.c +++ b/common/utils.c @@ -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