]> granicus.if.org Git - neomutt/commitdiff
Add strcasestr() from uclibc to unbreak (Open)Solaris build. Closes #3222.
authorRocco Rutte <pdmef@gmx.net>
Sat, 25 Apr 2009 08:35:42 +0000 (10:35 +0200)
committerRocco Rutte <pdmef@gmx.net>
Sat, 25 Apr 2009 08:35:42 +0000 (10:35 +0200)
ChangeLog
configure.ac
protos.h
strcasestr.c [new file with mode: 0644]

index 9b807e900f1a258ca69a84c25f409c309c360ba4..1dba001bea48ddaf97c1c951912286b2d3880d63 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+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
index c45344338fb2d21fd6b4de75ceb80bc6bdb63200..fe479b7a9872cf7b36c3d83c6e3f0dd82626ed99 100644 (file)
@@ -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
index bc49b8df01a57ee354de3b10081a833126cb66ca..6fcc601592464dca11781f0e268f05035607db1a 100644 (file)
--- a/protos.h
+++ b/protos.h
@@ -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
diff --git a/strcasestr.c b/strcasestr.c
new file mode 100644 (file)
index 0000000..a93b6af
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * 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
+}