summaryrefslogblamecommitdiff
path: root/src/string/strcasecmp.c
blob: dd87905222506604430918653ed4c507d4ae6bd2 (plain) (tree)
1
2
3
4
5
6
7
8
9








                                                                               
#include <strings.h>
#include <ctype.h>

int strcasecmp(const char *_l, const char *_r)
{
	const unsigned char *l=_l, *r=_r;
	for (; *l && *r && (*l == *r || tolower(*l) == tolower(*r)); l++, r++);
	return tolower(*l) - tolower(*r);
}