Cleanup for some problems in tsearch patch:
Tom Lane <tgl@sss.pgh.pa.us>
Cleanup for some problems in tsearch patch: - ispell initialization crashed on empty dictionary file - ispell initialization crashed on affix file with prefixes but no suffixes - stop words file was run through pg_verify_mbstr, with database encoding, but it's supposed to be UTF-8; similar bug for synonym files - bunch of comments added, typos fixed, and other cleanup Introduced consistent encoding checking/conversion of data read from tsearch configuration files, by doing this in a single t_readline() subroutine (replacing direct usages of fgets). Cleaned up API for readstopwords too. Heikki Linnakangas
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/snowball/dict_snowball.c | modified | +2 −4 |
| src/backend/tsearch/dict_ispell.c | modified | +2 −4 |
| src/backend/tsearch/dict_simple.c | modified | +8 −11 |
| src/backend/tsearch/dict_synonym.c | modified | +48 −36 |
| src/backend/tsearch/dict_thesaurus.c | modified | +15 −15 |
| src/backend/tsearch/spell.c | modified | +129 −134 |
| src/backend/tsearch/ts_locale.c | modified | +36 −14 |
| src/backend/tsearch/ts_parse.c | modified | +13 −13 |
| src/backend/tsearch/ts_utils.c | modified | +35 −36 |
| src/backend/tsearch/wparser.c | modified | +5 −5 |
| src/include/tsearch/dicts/spell.h | modified | +28 −12 |
| src/include/tsearch/ts_locale.h | modified | +6 −6 |
| src/include/tsearch/ts_public.h | modified | +6 −8 |
| src/include/tsearch/ts_utils.h | modified | +8 −30 |