1 /* public domain rewrite of strcasecmp(3) */
2
3 #include <ctype.h>
4
5 int
6 strcasecmp(p1, p2)
7 char *p1, *p2;
8 {
9 while (*p1 && *p2) {
10 if (toupper(*p1) != toupper(*p2))
11 return toupper(*p1) - toupper(*p2);
12 p1++;
13 p2++;
14 }
15 return strlen(p1) - strlen(p2);
16 }