From f189a122265a964cdd7f5ce44447afb9f45f1aa0 Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Fri, 17 Oct 2008 17:40:14 +0000 Subject: [PATCH] Fix small bug in headline generation. Patch from Sushant Sinha http://archives.postgresql.org/pgsql-hackers/2008-07/msg00785.php --- contrib/tsearch2/wparser_def.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/tsearch2/wparser_def.c b/contrib/tsearch2/wparser_def.c index b20909ce5b..f1f168de90 100644 --- a/contrib/tsearch2/wparser_def.c +++ b/contrib/tsearch2/wparser_def.c @@ -110,7 +110,7 @@ hlCover(HLPRSTEXT * prs, QUERYTYPE * query, int *p, int *q) ITEM *item = GETQUERY(query); int pos = *p; - *q = 0; + *q = -1; *p = 0x7fffffff; for (j = 0; j < query->size; j++) @@ -132,7 +132,7 @@ hlCover(HLPRSTEXT * prs, QUERYTYPE * query, int *p, int *q) item++; } - if (*q == 0) + if (*q < 0) return false; item = GETQUERY(query);