diff --git a/src/backend/tsearch/spell.c b/src/backend/tsearch/spell.c index f5f14c8b1fd..f2cfabba1cb 100644 --- a/src/backend/tsearch/spell.c +++ b/src/backend/tsearch/spell.c @@ -1370,8 +1370,10 @@ NISortAffixes(IspellDict *Conf) if ((Affix->flagflags & FF_COMPOUNDFLAG) && Affix->replen > 0 && isAffixInUse(Conf, (char) 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)) @@ -1379,7 +1381,7 @@ NISortAffixes(IspellDict *Conf) /* leave only unique and minimals suffixes */ ptr->affix = Affix->repl; ptr->len = Affix->replen; - ptr->issuffix = (Affix->type == FF_SUFFIX) ? true : false; + ptr->issuffix = issuffix; ptr++; } }