File tree 2 files changed +9
-8
lines changed 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 1
- /* $PostgreSQL: pgsql/contrib/tsearch2/dict_syn.c,v 1.12 2007/02/08 11:10:26 petere Exp $ */
1
+ /* $PostgreSQL: pgsql/contrib/tsearch2/dict_syn.c,v 1.13 2007/03/26 12:25:35 teodor Exp $ */
2
2
3
3
/*
4
4
* ISpell interface
@@ -40,7 +40,7 @@ findwrd(char *in, char **end)
40
40
while (* in && isspace ((unsigned char ) * in ))
41
41
in ++ ;
42
42
43
- if (! in )
43
+ if (* in == '\0' )
44
44
return NULL ;
45
45
start = in ;
46
46
@@ -103,10 +103,7 @@ syn_init(PG_FUNCTION_ARGS)
103
103
104
104
while (fgets (buf , sizeof (buf ), fin ))
105
105
{
106
- slen = strlen (buf ) - 1 ;
107
- buf [slen ] = '\0' ;
108
- if (* buf == '\0' )
109
- continue ;
106
+ pg_verifymbstr (buf , strlen (buf ), false);
110
107
if (cur == d -> len )
111
108
{
112
109
d -> len = (d -> len ) ? 2 * d -> len : 16 ;
Original file line number Diff line number Diff line change @@ -47,9 +47,13 @@ readstoplist(text *in, StopList * s)
47
47
48
48
while (fgets (buf , sizeof (buf ), hin ))
49
49
{
50
- buf [strlen (buf ) - 1 ] = '\0' ;
50
+ pbuf = buf ;
51
+ while ( !isspace ( * pbuf ) )
52
+ pbuf ++ ;
53
+ * pbuf = '\0' ;
54
+
51
55
pg_verifymbstr (buf , strlen (buf ), false);
52
- if (* buf == '\0' )
56
+ if (* buf == '\0' || * buf == '\n' || * buf == '\r' )
53
57
continue ;
54
58
55
59
if (s -> len >= reallen )
You can’t perform that action at this time.
0 commit comments