From: Paul Ramsey Date: Wed, 17 Sep 2014 17:13:23 +0000 (+0000) Subject: #2931, BOX representation is case sensitive X-Git-Tag: 2.2.0rc1~843 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=298347bb3208a0bc39442772b573cc6937395813;p=postgis #2931, BOX representation is case sensitive git-svn-id: http://svn.osgeo.org/postgis/trunk@12982 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/lwgeom_box.c b/postgis/lwgeom_box.c index e81cb72a7..8f0bab74a 100644 --- a/postgis/lwgeom_box.c +++ b/postgis/lwgeom_box.c @@ -48,15 +48,21 @@ Datum BOX2D_in(PG_FUNCTION_ARGS) int nitems; double tmp; GBOX box; + int i; gbox_init(&box); - if (strstr(str,"BOX(") != str ) + if (strcasestr(str,"BOX(") != str ) { elog(ERROR,"box2d parser - doesnt start with BOX("); PG_RETURN_NULL(); } - nitems = sscanf(str,"BOX(%lf %lf,%lf %lf)", &box.xmin, &box.ymin, &box.xmax, &box.ymax); + + for(i = 0; str[i]; i++) { + str[i] = tolower(str[i]); + } + + nitems = sscanf(str,"box(%lf %lf,%lf %lf)", &box.xmin, &box.ymin, &box.xmax, &box.ymax); if (nitems != 4) { elog(ERROR,"box2d parser - couldnt parse. It should look like: BOX(xmin ymin,xmax ymax)");