summaryrefslogtreecommitdiff
path: root/contrib/tsearch/query.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/tsearch/query.c')
-rw-r--r--contrib/tsearch/query.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/contrib/tsearch/query.c b/contrib/tsearch/query.c
index c0e2cae916..80e5556994 100644
--- a/contrib/tsearch/query.c
+++ b/contrib/tsearch/query.c
@@ -241,16 +241,20 @@ pushval_morph(QPRS_STATE * state, int typeval, char *strval, int lenval)
lemm = lemmatize(token, &lenlemm, type);
if (lemm)
{
- if ( lemm==token ) {
- char *ptrs=token,*ptrd;
- ptrd = lemm = palloc(lenlemm+1);
- while(ptrs-token<lenlemm) {
+ if (lemm == token)
+ {
+ char *ptrs = token,
+ *ptrd;
+
+ ptrd = lemm = palloc(lenlemm + 1);
+ while (ptrs - token < lenlemm)
+ {
*ptrd = tolower((unsigned char) *ptrs);
ptrs++;
ptrd++;
}
- *ptrd='\0';
- }
+ *ptrd = '\0';
+ }
pushval_asis(state, VAL, lemm, lenlemm);
pfree(lemm);
}