diff options
Diffstat (limited to 'contrib')
| -rw-r--r-- | contrib/dict_xsyn/dict_xsyn.c | 4 | ||||
| -rw-r--r-- | contrib/ltree/ltree_io.c | 8 | ||||
| -rw-r--r-- | contrib/ltree/ltxtquery_io.c | 2 | ||||
| -rw-r--r-- | contrib/pg_trgm/trgm.h | 6 | ||||
| -rw-r--r-- | contrib/unaccent/unaccent.c | 2 |
5 files changed, 8 insertions, 14 deletions
diff --git a/contrib/dict_xsyn/dict_xsyn.c b/contrib/dict_xsyn/dict_xsyn.c index 3635ed1df84..f8c0a5bf5c5 100644 --- a/contrib/dict_xsyn/dict_xsyn.c +++ b/contrib/dict_xsyn/dict_xsyn.c @@ -48,14 +48,14 @@ find_word(char *in, char **end) char *start; *end = NULL; - while (*in && t_isspace(in)) + while (*in && isspace((unsigned char) *in)) in += pg_mblen(in); if (!*in || *in == '#') return NULL; start = in; - while (*in && !t_isspace(in)) + while (*in && !isspace((unsigned char) *in)) in += pg_mblen(in); *end = in; diff --git a/contrib/ltree/ltree_io.c b/contrib/ltree/ltree_io.c index 11eefc809b2..b54a15d6c68 100644 --- a/contrib/ltree/ltree_io.c +++ b/contrib/ltree/ltree_io.c @@ -411,7 +411,7 @@ parse_lquery(const char *buf, struct Node *escontext) case LQPRS_WAITFNUM: if (t_iseq(ptr, ',')) state = LQPRS_WAITSNUM; - else if (t_isdigit(ptr)) + else if (isdigit((unsigned char) *ptr)) { int low = atoi(ptr); @@ -429,7 +429,7 @@ parse_lquery(const char *buf, struct Node *escontext) UNCHAR; break; case LQPRS_WAITSNUM: - if (t_isdigit(ptr)) + if (isdigit((unsigned char) *ptr)) { int high = atoi(ptr); @@ -460,7 +460,7 @@ parse_lquery(const char *buf, struct Node *escontext) case LQPRS_WAITCLOSE: if (t_iseq(ptr, '}')) state = LQPRS_WAITEND; - else if (!t_isdigit(ptr)) + else if (!isdigit((unsigned char) *ptr)) UNCHAR; break; case LQPRS_WAITND: @@ -471,7 +471,7 @@ parse_lquery(const char *buf, struct Node *escontext) } else if (t_iseq(ptr, ',')) state = LQPRS_WAITSNUM; - else if (!t_isdigit(ptr)) + else if (!isdigit((unsigned char) *ptr)) UNCHAR; break; case LQPRS_WAITEND: diff --git a/contrib/ltree/ltxtquery_io.c b/contrib/ltree/ltxtquery_io.c index 121fc55e469..7b8fba17ff2 100644 --- a/contrib/ltree/ltxtquery_io.c +++ b/contrib/ltree/ltxtquery_io.c @@ -88,7 +88,7 @@ gettoken_query(QPRS_STATE *state, int32 *val, int32 *lenval, char **strval, uint *lenval = charlen; *flag = 0; } - else if (!t_isspace(state->buf)) + else if (!isspace((unsigned char) *state->buf)) ereturn(state->escontext, ERR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("operand syntax error"))); diff --git a/contrib/pg_trgm/trgm.h b/contrib/pg_trgm/trgm.h index afb0adb222b..10827563694 100644 --- a/contrib/pg_trgm/trgm.h +++ b/contrib/pg_trgm/trgm.h @@ -15,7 +15,6 @@ */ #define LPADDING 2 #define RPADDING 1 -#define KEEPONLYALNUM /* * Caution: IGNORECASE macro means that trigrams are case-insensitive. * If this macro is disabled, the ~* and ~~* operators must be removed from @@ -51,13 +50,8 @@ typedef char trgm[3]; *(((char*)(a))+2) = *(((char*)(b))+2); \ } while(0) -#ifdef KEEPONLYALNUM #define ISWORDCHR(c) (t_isalnum(c)) #define ISPRINTABLECHAR(a) ( isascii( *(unsigned char*)(a) ) && (isalnum( *(unsigned char*)(a) ) || *(unsigned char*)(a)==' ') ) -#else -#define ISWORDCHR(c) (!t_isspace(c)) -#define ISPRINTABLECHAR(a) ( isascii( *(unsigned char*)(a) ) && isprint( *(unsigned char*)(a) ) ) -#endif #define ISPRINTABLETRGM(t) ( ISPRINTABLECHAR( ((char*)(t)) ) && ISPRINTABLECHAR( ((char*)(t))+1 ) && ISPRINTABLECHAR( ((char*)(t))+2 ) ) #define ISESCAPECHAR(x) (*(x) == '\\') /* Wildcard escape character */ diff --git a/contrib/unaccent/unaccent.c b/contrib/unaccent/unaccent.c index 0217696aac1..fcc25dc7139 100644 --- a/contrib/unaccent/unaccent.c +++ b/contrib/unaccent/unaccent.c @@ -155,7 +155,7 @@ initTrie(const char *filename) { ptrlen = pg_mblen(ptr); /* ignore whitespace, but end src or trg */ - if (t_isspace(ptr)) + if (isspace((unsigned char) *ptr)) { if (state == 1) state = 2; |
