]> granicus.if.org Git - postgresql/commitdiff
Fix small bug in headline generation.
authorTeodor Sigaev <teodor@sigaev.ru>
Fri, 17 Oct 2008 17:41:16 +0000 (17:41 +0000)
committerTeodor Sigaev <teodor@sigaev.ru>
Fri, 17 Oct 2008 17:41:16 +0000 (17:41 +0000)
Patch from Sushant Sinha <sushant354@gmail.com>
http://archives.postgresql.org/pgsql-hackers/2008-07/msg00785.php

contrib/tsearch2/wparser_def.c

index 6686257887222aa2face214f4d3dfd24cb7a8190..5ae70067a5b86d34a0a5d770530d66354d41f58f 100644 (file)
@@ -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);