~ubuntu-branches/ubuntu/trusty/postgresql-8.4/trusty

« back to all changes in this revision

Viewing changes to src/backend/tsearch/ts_parse.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-11 16:59:35 UTC
  • mfrom: (5.1.1 karmic)
  • Revision ID: james.westby@ubuntu.com-20090711165935-jfwin6gfrxf0gfsi
Tags: 8.4.0-2
* debian/libpq-dev.install: Ship catalog/genbki.h. (Closes: #536139)
* debian/rules: Drop --enable-cassert for final release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 *
8
8
 *
9
9
 * IDENTIFICATION
10
 
 *        $PostgreSQL: pgsql/src/backend/tsearch/ts_parse.c,v 1.11 2009/01/15 16:33:59 teodor Exp $
 
10
 *        $PostgreSQL: pgsql/src/backend/tsearch/ts_parse.c,v 1.12 2009/06/11 14:49:03 momjian Exp $
11
11
 *
12
12
 *-------------------------------------------------------------------------
13
13
 */
464
464
        for (i = 0; i < query->size; i++)
465
465
        {
466
466
                if (item->type == QI_VAL &&
467
 
                        tsCompareString( GETOPERAND(query) + item->operand.distance, item->operand.length,
468
 
                                                         buf, buflen, item->operand.prefix ) == 0 )
 
467
                        tsCompareString(GETOPERAND(query) + item->operand.distance, item->operand.length,
 
468
                                                        buf, buflen, item->operand.prefix) == 0)
469
469
                {
470
470
                        if (word->item)
471
471
                        {
584
584
{
585
585
        text       *out;
586
586
        char       *ptr;
587
 
        int                     len          = 128;
588
 
        int                     numfragments = 0;
589
 
        int2                    infrag       = 0;
 
587
        int                     len = 128;
 
588
        int                     numfragments = 0;
 
589
        int2            infrag = 0;
590
590
 
591
591
        HeadlineWordEntry *wrd = prs->words;
592
592
 
611
611
 
612
612
                                /* start of a new fragment */
613
613
                                infrag = 1;
614
 
                                numfragments ++;
615
 
                                /* add a fragment delimitor if this is after the first one */ 
 
614
                                numfragments++;
 
615
                                /* add a fragment delimitor if this is after the first one */
616
616
                                if (numfragments > 1)
617
617
                                {
618
618
                                        memcpy(ptr, prs->fragdelim, prs->fragdelimlen);
619
619
                                        ptr += prs->fragdelimlen;
620
 
                                }       
 
620
                                }
621
621
 
622
 
                        }       
 
622
                        }
623
623
                        if (wrd->replace)
624
624
                        {
625
625
                                *ptr = ' ';
646
646
                        if (infrag)
647
647
                                infrag = 0;
648
648
                        pfree(wrd->word);
649
 
                }       
 
649
                }
650
650
 
651
651
                wrd++;
652
652
        }