summaryrefslogtreecommitdiffstats
path: root/libc/string/strcasestr.c
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2006-02-25 04:03:33 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2006-02-25 04:03:33 +0000
commitcb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8 (patch)
tree520f8e8d113184cfa7954ebd274564b8c255fa9a /libc/string/strcasestr.c
parente4461be66e2655058aef358b00050bc70ac72861 (diff)
downloaduClibc-alpine-cb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8.tar.bz2
uClibc-alpine-cb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8.tar.xz
Merge from trunk. Going pretty good so far. Kind of. Okay, not really.
Diffstat (limited to 'libc/string/strcasestr.c')
-rw-r--r--libc/string/strcasestr.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/libc/string/strcasestr.c b/libc/string/strcasestr.c
index 5222eda71..72c1e4702 100644
--- a/libc/string/strcasestr.c
+++ b/libc/string/strcasestr.c
@@ -8,7 +8,14 @@
#include "_string.h"
#include <ctype.h>
-char attribute_hidden *__strcasestr(const char *s1, const char *s2)
+#ifndef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_tolower)
+#else
+libc_hidden_proto(__ctype_tolower_loc)
+#endif
+libc_hidden_proto(tolower)
+
+char *strcasestr(const char *s1, const char *s2)
{
register const char *s = s1;
register const char *p = s2;
@@ -19,7 +26,7 @@ char attribute_hidden *__strcasestr(const char *s1, const char *s2)
return (char *) s1;;
}
if ((*p == *s)
- || (__tolower(*((unsigned char *)p)) == __tolower(*((unsigned char *)s)))
+ || (tolower(*((unsigned char *)p)) == tolower(*((unsigned char *)s)))
) {
++p;
++s;
@@ -34,7 +41,7 @@ char attribute_hidden *__strcasestr(const char *s1, const char *s2)
#else
while (*p && *s) {
if ((*p == *s)
- || (__tolower(*((unsigned char *)p)) == __tolower(*((unsigned char *)s)))
+ || (tolower(*((unsigned char *)p)) == tolower(*((unsigned char *)s)))
) {
++p;
++s;
@@ -47,5 +54,3 @@ char attribute_hidden *__strcasestr(const char *s1, const char *s2)
return (*p) ? NULL : (char *) s1;
#endif
}
-
-strong_alias(__strcasestr,strcasestr)