diff --git a/src/backend/tsearch/spell.c b/src/backend/tsearch/spell.c index b9fdd77e19..65d99da292 100644 --- a/src/backend/tsearch/spell.c +++ b/src/backend/tsearch/spell.c @@ -1963,8 +1963,10 @@ NISortAffixes(IspellDict *Conf) if ((Affix->flagflags & FF_COMPOUNDFLAG) && Affix->replen > 0 && isAffixInUse(Conf, Affix->flag)) { + bool issuffix = (Affix->type == FF_SUFFIX); + if (ptr == Conf->CompoundAffix || - ptr->issuffix != (ptr - 1)->issuffix || + issuffix != (ptr - 1)->issuffix || strbncmp((const unsigned char *) (ptr - 1)->affix, (const unsigned char *) Affix->repl, (ptr - 1)->len)) @@ -1972,7 +1974,7 @@ NISortAffixes(IspellDict *Conf) /* leave only unique and minimals suffixes */ ptr->affix = Affix->repl; ptr->len = Affix->replen; - ptr->issuffix = (Affix->type == FF_SUFFIX); + ptr->issuffix = issuffix; ptr++; } }