From: Teodor Sigaev Date: Fri, 17 Oct 2008 17:41:16 +0000 (+0000) Subject: Fix small bug in headline generation. X-Git-Tag: REL8_1_15~8 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=feb45966970e6aa6cfdb2a42eaa0cba8472d94fb;p=users%2Fgsingh%2Fpostgres.git Fix small bug in headline generation. Patch from Sushant Sinha http://archives.postgresql.org/pgsql-hackers/2008-07/msg00785.php --- diff --git a/contrib/tsearch2/wparser_def.c b/contrib/tsearch2/wparser_def.c index 6686257887..5ae70067a5 100644 --- a/contrib/tsearch2/wparser_def.c +++ b/contrib/tsearch2/wparser_def.c @@ -107,7 +107,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++) @@ -129,7 +129,7 @@ hlCover(HLPRSTEXT * prs, QUERYTYPE * query, int *p, int *q) item++; } - if (*q == 0) + if (*q < 0) return false; item = GETQUERY(query);