X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=lib%2Fstring.c;h=5efafed3d6b65df9e56f968e32fb012f4cd13c65;hb=a2cdebe33f4c40a1bc7f66522303df89d5026cb4;hp=bab440fb0dfcb99dfe46453350f7b6e9298c89eb;hpb=ef29498655b18d2bfd69048e20835d19333981ab;p=mv-sheeva.git diff --git a/lib/string.c b/lib/string.c index bab440fb0df..5efafed3d6b 100644 --- a/lib/string.c +++ b/lib/string.c @@ -60,6 +60,34 @@ int strnicmp(const char *s1, const char *s2, size_t len) EXPORT_SYMBOL(strnicmp); #endif +#ifndef __HAVE_ARCH_STRCASECMP +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; +} +EXPORT_SYMBOL(strcasecmp); +#endif + +#ifndef __HAVE_ARCH_STRNCASECMP +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; +} +EXPORT_SYMBOL(strncasecmp); +#endif + #ifndef __HAVE_ARCH_STRCPY /** * strcpy - Copy a %NUL terminated string