summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2006-10-12 16:57:18 +0000
committerStef Walter <stef@memberwebs.com>2006-10-12 16:57:18 +0000
commit310e1d3b2ef4ebf868020debb3b4bb6190e12367 (patch)
tree0dd3ec9ea68de7c3b5c1ae16ffe1771f2c3f0d8f
parentf0f9f9b90b4cedd0fb24db012770ec7c95a9cce9 (diff)
Add strcasestr which is missing on solaris.
-rw-r--r--ChangeLog1
-rw-r--r--common/compat.c28
-rw-r--r--common/compat.h4
-rw-r--r--configure.in6
4 files changed, 36 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 63cd3dd..22e69bd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
1.6 [???]
- On FreeBSD fix problem where stderr wasn't processed when filter
didn't read stdin.
+ - Add strcasestr which is missing on Solaris.
1.5 [2006-09-05]
- Added support for setting the REMOTE variable when an XFORWARD
diff --git a/common/compat.c b/common/compat.c
index 40e4c73..1c620aa 100644
--- a/common/compat.c
+++ b/common/compat.c
@@ -179,6 +179,34 @@ size_t strlcat(char* dst, const char* src, size_t siz)
#endif
+#ifndef HAVE_STRCASESTR
+
+const char* strcasestr(const char *s, const char *find)
+{
+ char c, sc;
+ size_t len;
+
+ if((c = *find++) != 0)
+ {
+ c = tolower((unsigned char)c);
+ len = strlen(find);
+ do
+ {
+ do
+ {
+ if((sc = *s++) == 0)
+ return (NULL);
+ }
+ while((char)tolower((unsigned char)sc) != c);
+ }
+ while (strncasecmp(s, find, len) != 0);
+ s--;
+ }
+ return((const char*)s);
+}
+
+#endif
+
#ifndef HAVE_SETENV
#include <stdio.h>
diff --git a/common/compat.h b/common/compat.h
index 44c45e0..89f7fbb 100644
--- a/common/compat.h
+++ b/common/compat.h
@@ -88,6 +88,10 @@ size_t strlcat(char *dst, const char *src, size_t size);
size_t strlcpy(char *dst, const char *src, size_t size);
#endif
+#ifndef HAVE_STRCASESTR
+const char* strcasestr(const char *s, const char *find);
+#endif
+
#ifndef HAVE_SETENV
int setenv(const char* name, const char* value, int overwrite);
#endif
diff --git a/configure.in b/configure.in
index 844fc7e..bc68f2f 100644
--- a/configure.in
+++ b/configure.in
@@ -36,8 +36,8 @@ dnl Nate Nielsen <nielsen@memberwebs.com>
dnl
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(proxsmtp, 1.5.90, nielsen@memberwebs.com)
-AM_INIT_AUTOMAKE(proxsmtp, 1.5.90)
+AC_INIT(proxsmtp, 1.5.91, nielsen@memberwebs.com)
+AM_INIT_AUTOMAKE(proxsmtp, 1.5.91)
LDFLAGS="$LDFLAGS -L/usr/local/lib"
CFLAGS="$CFLAGS -I/usr/local/include"
@@ -106,7 +106,7 @@ AC_CHECK_GLOBAL(__argv)
# Required Functions
AC_CHECK_FUNCS([memset strerror malloc realloc getopt strchr tolower getaddrinfo usleep], ,
[echo "ERROR: Required function missing"; exit 1])
-AC_CHECK_FUNCS([strlwr strlcat strlcpy strncat strncpy setenv daemon])
+AC_CHECK_FUNCS([strlwr strlcat strlcpy strncat strncpy strcasestr setenv daemon])
AC_CHECK_FUNCS([getline getdelim])
# Have to resolve this for the path below