aboutsummaryrefslogtreecommitdiff
path: root/src/string/wcsncasecmp.c
blob: c0948e861560575e84504872e7385586328b039a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <wchar.h>
#include <wctype.h>

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);
}


#ifdef TEST
int
main(void) {
	return 0;
}
#endif