Skip to content

Commit 65a69df

Browse files
committed
Fix bogus affix-merging code.
NISortAffixes() compared successive compound affixes incorrectly, thus possibly failing to merge identical affixes, or (less likely) merging ones that shouldn't be merged. The user-visible effects of this are unclear, to me anyway. Per bug #15150 from Alexander Lakhin. It's been broken for a long time, so back-patch to all supported branches. Arthur Zakirov Discussion: https://postgr.es/m/152353327780.31225.13445405496721177988@wrigleys.postgresql.org
1 parent b8ca984 commit 65a69df

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/backend/tsearch/spell.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,16 +1963,18 @@ NISortAffixes(IspellDict *Conf)
19631963
if ((Affix->flagflags & FF_COMPOUNDFLAG) && Affix->replen > 0 &&
19641964
isAffixInUse(Conf, Affix->flag))
19651965
{
1966+
bool issuffix = (Affix->type == FF_SUFFIX);
1967+
19661968
if (ptr == Conf->CompoundAffix ||
1967-
ptr->issuffix != (ptr - 1)->issuffix ||
1969+
issuffix != (ptr - 1)->issuffix ||
19681970
strbncmp((const unsigned char *) (ptr - 1)->affix,
19691971
(const unsigned char *) Affix->repl,
19701972
(ptr - 1)->len))
19711973
{
19721974
/* leave only unique and minimals suffixes */
19731975
ptr->affix = Affix->repl;
19741976
ptr->len = Affix->replen;
1975-
ptr->issuffix = (Affix->type == FF_SUFFIX);
1977+
ptr->issuffix = issuffix;
19761978
ptr++;
19771979
}
19781980
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy