diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-06-19 16:52:31 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-06-19 16:52:31 +0000 |
commit | cf66d2a69d3e99f96f7ed6a5c99a7c17ed59f88b (patch) | |
tree | f4af43325e5eca85407a09dca11cb4173b44bd0f /src | |
parent | bedba2cc0e30c68eeef19b7da51e9550164a1942 (diff) | |
download | postgresql-cf66d2a69d3e99f96f7ed6a5c99a7c17ed59f88b.tar.gz postgresql-cf66d2a69d3e99f96f7ed6a5c99a7c17ed59f88b.zip |
Fix a few places that were non-multibyte-safe in tsearch configuration file
parsing. Per bug #4253 from Giorgio Valoti.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/tsearch/spell.c | 12 | ||||
-rw-r--r-- | src/backend/tsearch/ts_utils.c | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/backend/tsearch/spell.c b/src/backend/tsearch/spell.c index 2cfc7ea7a33..f21143feb08 100644 --- a/src/backend/tsearch/spell.c +++ b/src/backend/tsearch/spell.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tsearch/spell.c,v 1.11.2.1 2008/06/18 20:55:49 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/tsearch/spell.c,v 1.11.2.2 2008/06/19 16:52:31 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -509,7 +509,7 @@ static void addFlagValue(IspellDict *Conf, char *s, uint32 val) { while (*s && t_isspace(s)) - s++; + s += pg_mblen(s); if (!*s) ereport(ERROR, @@ -595,7 +595,7 @@ NIImportOOAffixes(IspellDict *Conf, const char *filename) char *s = recoded + strlen("FLAG"); while (*s && t_isspace(s)) - s++; + s += pg_mblen(s); if (*s && STRNCMP(s, "default") != 0) ereport(ERROR, @@ -729,9 +729,9 @@ NIImportAffixes(IspellDict *Conf, const char *filename) s = recoded + (s - pstr); /* we need non-lowercased * string */ while (*s && !t_isspace(s)) - s++; + s += pg_mblen(s); while (*s && t_isspace(s)) - s++; + s += pg_mblen(s); if (*s && pg_mblen(s) == 1) { @@ -762,7 +762,7 @@ NIImportAffixes(IspellDict *Conf, const char *filename) flagflags = 0; while (*s && t_isspace(s)) - s++; + s += pg_mblen(s); oldformat = true; /* allow only single-encoded flags */ diff --git a/src/backend/tsearch/ts_utils.c b/src/backend/tsearch/ts_utils.c index 673b8195164..39bf6f78d99 100644 --- a/src/backend/tsearch/ts_utils.c +++ b/src/backend/tsearch/ts_utils.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tsearch/ts_utils.c,v 1.9.2.1 2008/06/18 20:55:49 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/tsearch/ts_utils.c,v 1.9.2.2 2008/06/19 16:52:31 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -97,7 +97,7 @@ readstoplist(const char *fname, StopList *s, char *(*wordop) (const char *)) /* Trim trailing space */ while (*pbuf && !t_isspace(pbuf)) - pbuf++; + pbuf += pg_mblen(pbuf); *pbuf = '\0'; /* Skip empty lines */ |