X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstring%2Fwcsncasecmp.c;fp=src%2Fstring%2Fwcsncasecmp.c;h=8fefe799c4370312f7539cc7a2e24016d9b7f546;hb=e0614f7cd418afedd06c9bcd5abb965608bc52f8;hp=0000000000000000000000000000000000000000;hpb=899b13cae77469a9ed1f076c456b66d567af69d8;p=musl diff --git a/src/string/wcsncasecmp.c b/src/string/wcsncasecmp.c new file mode 100644 index 00000000..8fefe799 --- /dev/null +++ b/src/string/wcsncasecmp.c @@ -0,0 +1,9 @@ +#include +#include + +int wcsncasecmp(const wchar_t *l, const wchar_t *r, size_t n) +{ + if (!n--) return 0; + for (; *l && *r && n && (*l == *r || towlower(*l) == towlower(*r)); l++, r++, n--); + return towlower(*l) - towlower(*r); +}