Magnus Hagander. Also, now it ignores space symbol after stopwords.
-/* $PostgreSQL: pgsql/contrib/tsearch2/dict_syn.c,v 1.12 2007/02/08 11:10:26 petere Exp $ */
+/* $PostgreSQL: pgsql/contrib/tsearch2/dict_syn.c,v 1.13 2007/03/26 12:25:35 teodor Exp $ */
/*
* ISpell interface
while (*in && isspace((unsigned char) *in))
in++;
- if (!in)
+ if (*in=='\0')
return NULL;
start = in;
while (fgets(buf, sizeof(buf), fin))
{
- slen = strlen(buf) - 1;
- buf[slen] = '\0';
- if (*buf == '\0')
- continue;
+ pg_verifymbstr(buf, strlen(buf), false);
if (cur == d->len)
{
d->len = (d->len) ? 2 * d->len : 16;
while (fgets(buf, sizeof(buf), hin))
{
- buf[strlen(buf) - 1] = '\0';
+ pbuf = buf;
+ while( !isspace( *pbuf ) )
+ pbuf++;
+ *pbuf = '\0';
+
pg_verifymbstr(buf, strlen(buf), false);
- if (*buf == '\0')
+ if (*buf == '\0' || *buf=='\n' || *buf=='\r')
continue;
if (s->len >= reallen)