Commit a4581ec2 authored by Raúl Marín's avatar Raúl Marín

Use user provided CFLAGS in the address standardizer

Closes https://github.com/postgis/postgis/pull/280
Closes #4140


git-svn-id: http://svn.osgeo.org/postgis/trunk@16674 b70326c6-7e19-0410-871a-916f4a2858ee
parent ab272332
Pipeline #26804047 passed with stage
in 23 minutes and 3 seconds
......@@ -8,7 +8,8 @@ New since PostGIS 2.5.0beta1
(Vinícius A.B. Schmidt, Darafei Praliaskouski)
- #4109, Fix WKT parser accepting and interpreting numbers numbers with
multiple dots (Raúl Marín, Paul Ramsey)
- #4140, Use user-provided CFLAGS in the topology module (Raúl Marín)
- #4140, Use user-provided CFLAGS in address standardizer and the
topology module (Raúl Marín)
See PostGIS 2.5.0 section for full details
......
......@@ -51,7 +51,7 @@ EXTRA_CLEAN += sql/*.sql
DOCS = README.address_standardizer
PG_CPPFLAGS = @CPPFLAGS@ -g -O0
PG_CPPFLAGS = @CFLAGS@ @CPPFLAGS@
SHLIB_LINK = @SHLIB_LINK@ -lpcre
EXTRA_CLEAN = usps-st-city-name.txt mk-st-regexp mk-city-regex test_main
......
......@@ -57,7 +57,7 @@ const char *get_state_regex(char *st)
int clean_trailing_punct(char *s)
{
int i;
size_t i;
int ret = 0;
i=strlen(s)-1;
......@@ -70,7 +70,7 @@ int clean_trailing_punct(char *s)
char *clean_leading_punct(char *s)
{
int i;
size_t i;
for (i=0; i<strlen(s); i++)
if (!(ispunct(s[i]) || isspace(s[i])))
......@@ -81,7 +81,7 @@ char *clean_leading_punct(char *s)
void strtoupper(char *s)
{
int i;
size_t i;
for (i=0; i<strlen(s); i++)
s[i] = toupper(s[i]);
......@@ -120,7 +120,7 @@ ADDRESS *parseaddress(HHash *stH, char *s, int *reterr)
char *state = NULL;
char *regx;
int mi;
int i, j;
size_t ui, uj;
int rc;
int comma = 0;
ADDRESS *ret;
......@@ -145,16 +145,16 @@ ADDRESS *parseaddress(HHash *stH, char *s, int *reterr)
/* clean the string of multiple white spaces and . */
for (i=0, j=0; i<strlen(s); i++) {
c = s[i];
if (c == '.') c = s[i] = ' ';
if (j == 0 && isspace(c)) continue;
if (i && isspace(c) && isspace(s[i-1])) continue;
s[j] = s[i];
j++;
for (ui=0, uj=0; ui<strlen(s); ui++) {
c = s[ui];
if (c == '.') c = s[ui] = ' ';
if (uj == 0 && isspace(c)) continue;
if (ui && isspace(c) && isspace(s[ui-1])) continue;
s[uj] = s[ui];
uj++;
}
if (isspace(s[j-1])) j--;
s[j] = '\0';
if (isspace(s[uj-1])) uj--;
s[uj] = '\0';
/* clean trailing punctuation */
comma |= clean_trailing_punct(s);
......@@ -299,6 +299,7 @@ ADDRESS *parseaddress(HHash *stH, char *s, int *reterr)
}
DBG("Checked for state-city: %d", rc);
if (rc <= 0) {
int i;
/* run through the regx's and see if we get a match */
for (i=0; i<nreg; i++) {
mi++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment