File hypermail-strcasestr.patch of Package hypermail
Index: hypermail-2.2.0.20070131/src/proto.h
===================================================================
--- hypermail-2.2.0.20070131.orig/src/proto.h
+++ hypermail-2.2.0.20070131/src/proto.h
@@ -101,7 +101,6 @@ char *PushByte(struct Push *, char);
char *PushString(struct Push *, const char *);
char *PushNString(struct Push *, const char *, int);
-char *strcasestr (char *, const char *);
char *strsav(const char *);
char *strreplace(char *, char *);
void strcpymax(char *, const char *, int);
Index: hypermail-2.2.0.20070131/src/string.c
===================================================================
--- hypermail-2.2.0.20070131.orig/src/string.c
+++ hypermail-2.2.0.20070131/src/string.c
@@ -471,100 +471,6 @@ void strtolower(char *string)
}
}
-#ifndef HAVE_STRCASESTR
-/*
-** strcasestr() - case insensitive strstr()
-*/
-
-/* Stolen-- stolen!-- from glibc 2.1. Please don't sue me. */
-
-char *strcasestr (char *phaystack, const char *pneedle)
-{
- register unsigned char *haystack;
- register const unsigned char *needle;
- register unsigned b, c;
-
- haystack = (unsigned char *) phaystack;
- needle = (const unsigned char *) pneedle;
-
- b = tolower (*needle);
- if (b != '\0')
- {
- haystack--; /* possible ANSI violation */
- do
- {
- c = *++haystack;
- if (c == '\0')
- goto ret0;
- }
- while (tolower (c) != b);
-
- c = tolower (*++needle);
- if (c == '\0')
- goto foundneedle;
- ++needle;
- goto jin;
-
- for (;;)
- {
- register unsigned a;
- register unsigned char *rhaystack;
- register const unsigned char *rneedle;
-
- do
- {
- a = *++haystack;
- if (a == '\0')
- goto ret0;
- if (tolower (a) == b)
- break;
- a = *++haystack;
- if (a == '\0')
- goto ret0;
-shloop: ;
- }
- while (tolower (a) != b);
-
-jin: a = *++haystack;
- if (a == '\0')
- goto ret0;
-
- if (tolower (a) != c)
- goto shloop;
-
- rhaystack = haystack-- + 1;
- rneedle = needle;
- a = tolower (*rneedle);
-
- if (tolower (*rhaystack) == a)
- do
- {
- if (a == '\0')
- goto foundneedle;
- ++rhaystack;
- a = tolower (*++needle);
- if (tolower (*rhaystack) != a)
- break;
- if (a == '\0')
- goto foundneedle;
- ++rhaystack;
- a = tolower (*++needle);
- }
- while (tolower (*rhaystack) == a);
-
- needle = rneedle; /* took the register-poor approach */
-
- if (a == '\0')
- break;
- }
- }
-foundneedle:
- return (char*) haystack;
-ret0:
- return 0;
-}
-#endif
-
/*
** Strips the timezone information from long date strings, so more correct
** comparisons can be made between dates when looking for article replies.