2011-02-12 00:22:29 -05:00
|
|
|
#include <strings.h>
|
|
|
|
#include <ctype.h>
|
2014-07-02 21:38:54 -04:00
|
|
|
#include "libc.h"
|
2011-02-12 00:22:29 -05:00
|
|
|
|
|
|
|
int strcasecmp(const char *_l, const char *_r)
|
|
|
|
{
|
2011-03-25 16:34:03 -04:00
|
|
|
const unsigned char *l=(void *)_l, *r=(void *)_r;
|
2011-02-12 00:22:29 -05:00
|
|
|
for (; *l && *r && (*l == *r || tolower(*l) == tolower(*r)); l++, r++);
|
|
|
|
return tolower(*l) - tolower(*r);
|
|
|
|
}
|
2014-07-02 21:38:54 -04:00
|
|
|
|
|
|
|
int __strcasecmp_l(const char *l, const char *r, locale_t loc)
|
|
|
|
{
|
|
|
|
return strcasecmp(l, r);
|
|
|
|
}
|
|
|
|
|
|
|
|
weak_alias(__strcasecmp_l, strcasecmp_l);
|