Ok, shoot holes in this one instead.
Linus
-----
static int strnicmp(const char *s1, const char *s2, int len)
{
/* Yes, Virginia, it had better be unsigned */
unsigned char c1, c2;
while (len) {
c1 = *s1; c2 = *s2;
s1++; s2++;
if (!c1)
goto end_of_string1;
if (!c2)
goto end_of_string2;
if (c1 != c2) {
c1 = tolower(c1);
c2 = tolower(c2);
if (c1 != c2)
goto different;
}
len--;
}
return 0;
end_of_string1:
return c2 ? -1 : 0;
end_of_string2:
return 1;
different:
return c1 < c2 ? -1 : 1;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html