From 006ff36c6262367888f67afb9b9ddabcc1e203b2 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 2 Dec 2024 11:34:17 +0100 Subject: [PATCH v2 3/4] Remove t_isprint() --- src/backend/tsearch/spell.c | 2 +- src/backend/tsearch/ts_locale.c | 15 --------------- src/include/tsearch/ts_locale.h | 1 - 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/backend/tsearch/spell.c b/src/backend/tsearch/spell.c index b41afbd7322..7eca1714e9b 100644 --- a/src/backend/tsearch/spell.c +++ b/src/backend/tsearch/spell.c @@ -542,7 +542,7 @@ NIImportDictionary(IspellDict *Conf, const char *filename) while (*s) { /* we allow only single encoded flags for faster works */ - if (pg_mblen(s) == 1 && t_isprint(s) && !isspace((unsigned char) *s)) + if (pg_mblen(s) == 1 && isprint((unsigned char) *s) && !isspace((unsigned char) *s)) s++; else { diff --git a/src/backend/tsearch/ts_locale.c b/src/backend/tsearch/ts_locale.c index 70a39f48814..a61fd36022e 100644 --- a/src/backend/tsearch/ts_locale.c +++ b/src/backend/tsearch/ts_locale.c @@ -61,21 +61,6 @@ t_isalnum(const char *ptr) return iswalnum((wint_t) character[0]); } -int -t_isprint(const char *ptr) -{ - int clen = pg_mblen(ptr); - wchar_t character[WC_BUF_LEN]; - pg_locale_t mylocale = 0; /* TODO */ - - if (clen == 1 || database_ctype_is_c) - return isprint(TOUCHAR(ptr)); - - char2wchar(character, WC_BUF_LEN, ptr, clen, mylocale); - - return iswprint((wint_t) character[0]); -} - /* * Set up to read a file using tsearch_readline(). This facility is diff --git a/src/include/tsearch/ts_locale.h b/src/include/tsearch/ts_locale.h index 9606bb30983..71e1f78fa36 100644 --- a/src/include/tsearch/ts_locale.h +++ b/src/include/tsearch/ts_locale.h @@ -41,7 +41,6 @@ typedef struct extern int t_isalpha(const char *ptr); extern int t_isalnum(const char *ptr); -extern int t_isprint(const char *ptr); extern char *lowerstr(const char *str); extern char *lowerstr_with_len(const char *str, int len); -- 2.47.1