Commit 906b7e5f authored by Teodor Sigaev's avatar Teodor Sigaev

Fix small bug in headline generation.

Patch from Sushant Sinha <sushant354@gmail.com>
http://archives.postgresql.org/pgsql-hackers/2008-07/msg00785.php
parent beeb3562
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/tsearch/wparser_def.c,v 1.15 2008/06/17 16:09:06 momjian Exp $ * $PostgreSQL: pgsql/src/backend/tsearch/wparser_def.c,v 1.16 2008/10/17 17:27:46 teodor Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1621,7 +1621,7 @@ hlCover(HeadlineParsedText *prs, TSQuery query, int *p, int *q) ...@@ -1621,7 +1621,7 @@ hlCover(HeadlineParsedText *prs, TSQuery query, int *p, int *q)
QueryItem *item = GETQUERY(query); QueryItem *item = GETQUERY(query);
int pos = *p; int pos = *p;
*q = 0; *q = -1;
*p = 0x7fffffff; *p = 0x7fffffff;
for (j = 0; j < query->size; j++) for (j = 0; j < query->size; j++)
...@@ -1643,7 +1643,7 @@ hlCover(HeadlineParsedText *prs, TSQuery query, int *p, int *q) ...@@ -1643,7 +1643,7 @@ hlCover(HeadlineParsedText *prs, TSQuery query, int *p, int *q)
item++; item++;
} }
if (*q == 0) if (*q < 0)
return false; return false;
item = GETQUERY(query); item = GETQUERY(query);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment