Commit 83d0b9f3 authored by Teodor Sigaev's avatar Teodor Sigaev

Fixes from Heikki Linnakangas <heikki@enterprisedb.com>:

Apparently it's a bug I introduced when I refactored spell.c to use the
readline function for reading and recoding the input file. I didn't
notice that some calls to STRNCMP used the non-lowercased version of the
input line.
parent f243a1a1
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/tsearch/spell.c,v 1.2 2007/08/25 00:03:59 tgl Exp $ * $PostgreSQL: pgsql/src/backend/tsearch/spell.c,v 1.3 2007/09/10 10:39:56 teodor Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -733,7 +733,6 @@ NIImportAffixes(IspellDict * Conf, const char *filename) ...@@ -733,7 +733,6 @@ NIImportAffixes(IspellDict * Conf, const char *filename)
while ((recoded = t_readline(affix)) != NULL) while ((recoded = t_readline(affix)) != NULL)
{ {
pstr = lowerstr(recoded); pstr = lowerstr(recoded);
pfree(recoded);
lineno++; lineno++;
...@@ -813,8 +812,8 @@ NIImportAffixes(IspellDict * Conf, const char *filename) ...@@ -813,8 +812,8 @@ NIImportAffixes(IspellDict * Conf, const char *filename)
flag = (unsigned char) *s; flag = (unsigned char) *s;
goto nextline; goto nextline;
} }
if (STRNCMP(str, "COMPOUNDFLAG") == 0 || STRNCMP(str, "COMPOUNDMIN") == 0 || if (STRNCMP(recoded, "COMPOUNDFLAG") == 0 || STRNCMP(recoded, "COMPOUNDMIN") == 0 ||
STRNCMP(str, "PFX") == 0 || STRNCMP(str, "SFX") == 0) STRNCMP(recoded, "PFX") == 0 || STRNCMP(recoded, "SFX") == 0)
{ {
if (oldformat) if (oldformat)
ereport(ERROR, ereport(ERROR,
...@@ -834,6 +833,7 @@ NIImportAffixes(IspellDict * Conf, const char *filename) ...@@ -834,6 +833,7 @@ NIImportAffixes(IspellDict * Conf, const char *filename)
NIAddAffix(Conf, flag, flagflags, mask, find, repl, suffixes ? FF_SUFFIX : FF_PREFIX); NIAddAffix(Conf, flag, flagflags, mask, find, repl, suffixes ? FF_SUFFIX : FF_PREFIX);
nextline: nextline:
pfree(recoded);
pfree(pstr); pfree(pstr);
} }
FreeFile(affix); FreeFile(affix);
......
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