X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fpowerpc%2Flib%2Fstrcase.c;fp=arch%2Fpowerpc%2Flib%2Fstrcase.c;h=f8ec1eba3fdde5c081cbfa042a2b2a96cec843aa;hb=16cf0ec7408f389279d413869e94c1a351392f97;hp=0000000000000000000000000000000000000000;hpb=65da6b7c3bf0bd6a149128079565e5f4efec28ac;p=linux-2.6.git diff --git a/arch/powerpc/lib/strcase.c b/arch/powerpc/lib/strcase.c new file mode 100644 index 000000000..f8ec1eba3 --- /dev/null +++ b/arch/powerpc/lib/strcase.c @@ -0,0 +1,25 @@ +#include +#include +#include + +int strcasecmp(const char *s1, const char *s2) +{ + int c1, c2; + + do { + c1 = tolower(*s1++); + c2 = tolower(*s2++); + } while (c1 == c2 && c1 != 0); + return c1 - c2; +} + +int strncasecmp(const char *s1, const char *s2, size_t n) +{ + int c1, c2; + + do { + c1 = tolower(*s1++); + c2 = tolower(*s2++); + } while ((--n > 0) && c1 == c2 && c1 != 0); + return c1 - c2; +}