From: Sandro Santilli Date: Mon, 23 Mar 2015 16:04:08 +0000 (+0000) Subject: Do not (re)define strcasestr in a public header (#3088) X-Git-Tag: 2.2.0rc1~572 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c2c40adf9cedf02de914cafddd09872c5af601cb;p=postgis Do not (re)define strcasestr in a public header (#3088) git-svn-id: http://svn.osgeo.org/postgis/trunk@13389 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/configure.ac b/configure.ac index 643c7e878..580cd9830 100644 --- a/configure.ac +++ b/configure.ac @@ -114,7 +114,6 @@ dnl Check for platform-specific functions dnl AC_CHECK_FUNC(vasprintf, AC_DEFINE([HAVE_VASPRINTF])) AC_CHECK_FUNC(asprintf, AC_DEFINE([HAVE_ASPRINTF])) -AC_CHECK_FUNC(strcasestr, AC_DEFINE([HAVE_STRCASESTR])) AC_FUNC_FSEEKO() dnl diff --git a/liblwgeom/liblwgeom.h.in b/liblwgeom/liblwgeom.h.in index 0b82836a6..eb0bff123 100644 --- a/liblwgeom/liblwgeom.h.in +++ b/liblwgeom/liblwgeom.h.in @@ -1991,10 +1991,6 @@ extern void lwfree(void *mem); /* Utilities */ extern char *lwmessage_truncate(char *str, int startpos, int endpos, int maxlength, int truncdirection); -#ifndef HAVE_STRCASESTR -extern char *strcasestr(const char *s, const char *find); -#endif - /******************************************************************************* * SQLMM internal functions - TODO: Move into separate header files ******************************************************************************/ diff --git a/liblwgeom/lwutil.c b/liblwgeom/lwutil.c index ee552ea8b..d7f59ae60 100644 --- a/liblwgeom/lwutil.c +++ b/liblwgeom/lwutil.c @@ -328,23 +328,3 @@ clamp_srid(int srid) return newsrid; } -#ifndef HAVE_STRCASESTR -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 ((char *)s); -} -#endif diff --git a/postgis/lwgeom_box.c b/postgis/lwgeom_box.c index 1dbea2dc7..4806cbfec 100644 --- a/postgis/lwgeom_box.c +++ b/postgis/lwgeom_box.c @@ -52,12 +52,6 @@ Datum BOX2D_in(PG_FUNCTION_ARGS) gbox_init(&box); - if (strcasestr(str,"BOX(") != str ) - { - elog(ERROR,"box2d parser - doesnt start with BOX("); - PG_RETURN_NULL(); - } - for(i = 0; str[i]; i++) { str[i] = tolower(str[i]); }