~ubuntu-branches/ubuntu/maverick/ruby1.8/maverick-security

1.1.5 by akira yamada
Import upstream version 1.8.6
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
}