]> git.saurik.com Git - apple/libc.git/blobdiff - string/FreeBSD/wcsncasecmp.c
Libc-1439.100.3.tar.gz
[apple/libc.git] / string / FreeBSD / wcsncasecmp.c
index 436a324dfd41109860cb7623bab48d4bbb1172e6..167fac15a888db0a1312136df3510267bc10e4d3 100644 (file)
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD: src/lib/libc/string/wcsncasecmp.c,v 1.1 2009/02/28 06:00:58 das Exp $");
 
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD: src/lib/libc/string/wcsncasecmp.c,v 1.1 2009/02/28 06:00:58 das Exp $");
 
+#include "xlocale_private.h"
+
 #include <wchar.h>
 #include <wctype.h>
 
 int
 #include <wchar.h>
 #include <wctype.h>
 
 int
-wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n)
+wcsncasecmp_l(const wchar_t *s1, const wchar_t *s2, size_t n, locale_t loc)
 {
        wchar_t c1, c2;
 
        if (n == 0)
                return (0);
        for (; *s1; s1++, s2++) {
 {
        wchar_t c1, c2;
 
        if (n == 0)
                return (0);
        for (; *s1; s1++, s2++) {
-               c1 = towlower(*s1);
-               c2 = towlower(*s2);
+               c1 = towlower_l(*s1, loc);
+               c2 = towlower_l(*s2, loc);
                if (c1 != c2)
                        return ((int)c1 - c2);
                if (--n == 0)
                if (c1 != c2)
                        return ((int)c1 - c2);
                if (--n == 0)
@@ -47,3 +49,9 @@ wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n)
        }
        return (-*s2);
 }
        }
        return (-*s2);
 }
+
+int
+wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n) {
+       return wcsncasecmp_l(s1, s2, n, __current_locale());
+}
+