Commit 96fd7673 authored by Rocco Rutte's avatar Rocco Rutte

Add strcasestr() from uclibc to unbreak (Open)Solaris build. Closes #3222.

parent 3845987d
2009-04-21 15:10 -0400 Aron Griffis <agriffis@n01se.net> (3d89eddb2d9a)
* buffy.c: Equivalent mutt_buffy, but readable code
Signed-off-by: Aron Griffis <agriffis@n01se.net>
2009-04-21 15:06 -0400 Aron Griffis <agriffis@n01se.net> (7bc332ddd8fc)
* buffy.c, buffy.h: Call mutt_expand_path() from mutt_buffy to fix
imap separator. Closes #3208 and #3218
Signed-off-by: Aron Griffis <agriffis@n01se.net>
2009-04-21 14:09 -0400 Aron Griffis <agriffis@n01se.net> (1dc96cc13a87)
* buffy.c: Use slen instead of assuming _POSIX_PATH_MAX
Signed-off-by: Aron Griffis <agriffis@n01se.net>
2009-04-23 12:51 -0700 Vincent Lefevre <vincent@vinc17.org> (b5b4e652e4b1)
* ChangeLog, po/fr.po: Updated French translation.
2009-04-20 18:36 +0200 Christoph Berg <cb@df7cb.de> (39fee3a9d034)
* doc/manual.xml.head, init.h: Better document that some send-hooks
......
......@@ -344,6 +344,7 @@ AC_CHECK_TYPE(ssize_t, int)
AC_CHECK_FUNCS(fgetpos memmove setegid srand48 strerror)
AC_REPLACE_FUNCS([setenv strcasecmp strdup strsep strtok_r wcscasecmp])
AC_REPLACE_FUNCS([strcasestr])
AC_CHECK_FUNC(getopt)
if test $ac_cv_func_getopt = yes; then
......
......@@ -552,3 +552,7 @@ char *strtok_r (char *, const char *, char **);
#ifndef HAVE_WCSCASECMP
int wcscasecmp (const wchar_t *a, const wchar_t *b);
#endif
#ifndef HAVE_STRCASESTR
char *strcasestr (const char *, const char *);
#endif
/*
* Copyright (C) 2002 Manuel Novoa III
* Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <stdlib.h>
#include <ctype.h>
char *strcasestr(const char *s1, const char *s2)
{
register const char *s = s1;
register const char *p = s2;
#if 1
do {
if (!*p) {
return (char *) s1;;
}
if ((*p == *s)
|| (tolower(*((unsigned char *)p)) == tolower(*((unsigned char *)s)))
) {
++p;
++s;
} else {
p = s2;
if (!*s) {
return NULL;
}
s = ++s1;
}
} while (1);
#else
while (*p && *s) {
if ((*p == *s)
|| (tolower(*((unsigned char *)p)) == tolower(*((unsigned char *)s)))
) {
++p;
++s;
} else {
p = s2;
s = ++s1;
}
}
return (*p) ? NULL : (char *) s1;
#endif
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment