Skip site navigation (1) Skip section navigation (2)

Bug: Contrib\fulltextindex\fti.c?

From: Paul McGarry <paulm(at)opentec(dot)com(dot)au>
To: pgsql-bugs(at)hub(dot)org
Subject: Bug: Contrib\fulltextindex\fti.c?
Date: 2000-07-04 04:03:44
Message-ID: 39616220.37A6E4DB@opentec.com.au (view raw or flat)
Thread:
Lists: pgsql-bugs
Hello,

Is it me, or does the declaration of difference as an unsigned int
prevent the if statements just below from working correctly?
Should it not be a normal int?

>From postgresql-7.0.2/contrib/fulltextindex/fti.c
======
bool
is_stopword(char *text)
{
	char	  **StopLow;		/* for list of stop-words */
	char	  **StopHigh;
	char	  **StopMiddle;
	unsigned int difference;

	StopLow = &StopWords[0];	/* initialize stuff for binary search */
	StopHigh = endof(StopWords);

	if (lengthof(StopWords) == 0)
		return false;

	while (StopLow <= StopHigh)
	{
		StopMiddle = StopLow + (StopHigh - StopLow) / 2;
		difference = strcmp(*StopMiddle, text);
		if (difference == 0)
			return (true);
		else if (difference < 0)
			StopLow = StopMiddle + 1;
		else
			StopHigh = StopMiddle - 1;
	}

	return (false);
}
======


-- 
Paul McGarry            mailto:paulm(at)opentec(dot)com(dot)au 
Systems Integrator      http://www.opentec.com.au 
Opentec Pty Ltd         http://www.iebusiness.com.au
6 Lyon Park Road        Phone: (02) 9878 1744 
North Ryde NSW 2113     Fax:   (02) 9878 1755

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2000-07-04 04:59:51
Subject: Re: Bug: Contrib\fulltextindex\fti.c?
Previous:From: Tom LaneDate: 2000-07-03 19:50:27
Subject: Re: \d* won't work in 7.0.2?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group