chiark / gitweb /
[PATCH] sync up with the 0.84 version of klibc
[elogind.git] / klibc / klibc / strcasecmp.c
1 /*
2  * strcasecmp.c
3  *
4  */
5
6 #include <string.h>
7 #include <ctype.h>
8
9 int strcasecmp(const char *s1, const char *s2)
10 {
11         char *n1, *n2;
12         int i, retval;
13
14         n1 = strdup(s1);
15         n2 = strdup(s2);
16
17         for (i = 0; i < strlen(n1); i++)
18                 n1[i] = toupper(n1[i]);
19         for (i = 0; i < strlen(n2); i++)
20                 n2[i] = toupper(n2[i]);
21         retval = strcmp(n1, n2);
22         free(n1);
23         free(n2);
24         return retval;
25 }