Fix a few places that were non-multibyte-safe in tsearch configuration file
parsing. Per bug #4253 from Giorgio Valoti.
This commit is contained in:
parent
e3ae27894a
commit
30dc388a0d
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/tsearch/spell.c,v 1.12 2008/06/18 20:55:42 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/tsearch/spell.c,v 1.13 2008/06/19 16:52:24 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -509,7 +509,7 @@ static void
|
|||||||
addFlagValue(IspellDict *Conf, char *s, uint32 val)
|
addFlagValue(IspellDict *Conf, char *s, uint32 val)
|
||||||
{
|
{
|
||||||
while (*s && t_isspace(s))
|
while (*s && t_isspace(s))
|
||||||
s++;
|
s += pg_mblen(s);
|
||||||
|
|
||||||
if (!*s)
|
if (!*s)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
@ -595,7 +595,7 @@ NIImportOOAffixes(IspellDict *Conf, const char *filename)
|
|||||||
char *s = recoded + strlen("FLAG");
|
char *s = recoded + strlen("FLAG");
|
||||||
|
|
||||||
while (*s && t_isspace(s))
|
while (*s && t_isspace(s))
|
||||||
s++;
|
s += pg_mblen(s);
|
||||||
|
|
||||||
if (*s && STRNCMP(s, "default") != 0)
|
if (*s && STRNCMP(s, "default") != 0)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
@ -729,9 +729,9 @@ NIImportAffixes(IspellDict *Conf, const char *filename)
|
|||||||
s = recoded + (s - pstr); /* we need non-lowercased
|
s = recoded + (s - pstr); /* we need non-lowercased
|
||||||
* string */
|
* string */
|
||||||
while (*s && !t_isspace(s))
|
while (*s && !t_isspace(s))
|
||||||
s++;
|
s += pg_mblen(s);
|
||||||
while (*s && t_isspace(s))
|
while (*s && t_isspace(s))
|
||||||
s++;
|
s += pg_mblen(s);
|
||||||
|
|
||||||
if (*s && pg_mblen(s) == 1)
|
if (*s && pg_mblen(s) == 1)
|
||||||
{
|
{
|
||||||
@ -762,7 +762,7 @@ NIImportAffixes(IspellDict *Conf, const char *filename)
|
|||||||
flagflags = 0;
|
flagflags = 0;
|
||||||
|
|
||||||
while (*s && t_isspace(s))
|
while (*s && t_isspace(s))
|
||||||
s++;
|
s += pg_mblen(s);
|
||||||
oldformat = true;
|
oldformat = true;
|
||||||
|
|
||||||
/* allow only single-encoded flags */
|
/* allow only single-encoded flags */
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/tsearch/ts_utils.c,v 1.11 2008/06/18 20:55:42 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/tsearch/ts_utils.c,v 1.12 2008/06/19 16:52:24 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -97,7 +97,7 @@ readstoplist(const char *fname, StopList *s, char *(*wordop) (const char *))
|
|||||||
|
|
||||||
/* Trim trailing space */
|
/* Trim trailing space */
|
||||||
while (*pbuf && !t_isspace(pbuf))
|
while (*pbuf && !t_isspace(pbuf))
|
||||||
pbuf++;
|
pbuf += pg_mblen(pbuf);
|
||||||
*pbuf = '\0';
|
*pbuf = '\0';
|
||||||
|
|
||||||
/* Skip empty lines */
|
/* Skip empty lines */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user