Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9dab425

Browse files
committed
Reverted patch for tsearch/spell.c, merged from the REL9_5_STABLE branch, because it breaks Artur's improvements to dictionary load code
1 parent481ce16 commit9dab425

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

‎src/backend/tsearch/spell.c

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -216,19 +216,6 @@ findchar(char *str, int c)
216216
returnNULL;
217217
}
218218

219-
staticchar*
220-
findchar2(char*str,intc1,intc2)
221-
{
222-
while (*str)
223-
{
224-
if (t_iseq(str,c1)||t_iseq(str,c2))
225-
returnstr;
226-
str+=pg_mblen(str);
227-
}
228-
229-
returnNULL;
230-
}
231-
232219

233220
/* backward string compare for suffix tree operations */
234221
staticint
@@ -1233,8 +1220,9 @@ NIImportOOAffixes(IspellDict *Conf, const char *filename)
12331220

12341221
if (flag==0)
12351222
gotonextline;
1236-
/* Get flags after '/' (flags are case sensitive) */
1237-
if ((ptr=strchr(repl,'/'))!=NULL)
1223+
prepl=lowerstr_ctx(Conf,repl);
1224+
/* Find position of '/' in lowercased string "prepl" */
1225+
if ((ptr=strchr(prepl,'/'))!=NULL)
12381226
{
12391227
/*
12401228
* Here we use non-lowercased string "repl". We need position
@@ -1244,10 +1232,6 @@ NIImportOOAffixes(IspellDict *Conf, const char *filename)
12441232
ptr=repl+ (ptr-prepl)+1;
12451233
aflg |=getFlagValues(Conf,getFlags(Conf,ptr));
12461234
}
1247-
/* Get lowercased version of string before '/' */
1248-
prepl=lowerstr_ctx(Conf,repl);
1249-
if ((ptr=strchr(prepl,'/'))!=NULL)
1250-
*ptr='\0';
12511235
pfind=lowerstr_ctx(Conf,find);
12521236
pmask=lowerstr_ctx(Conf,mask);
12531237
if (t_iseq(find,'0'))
@@ -1317,10 +1301,12 @@ NIImportAffixes(IspellDict *Conf, const char *filename)
13171301

13181302
if (STRNCMP(pstr,"compoundwords")==0)
13191303
{
1320-
/* Findcase-insensitive L flaginnon-lowercased string */
1321-
s=findchar2(recoded,'l','L');
1304+
/* Findpositionin lowercased string "pstr" */
1305+
s=findchar(pstr,'l');
13221306
if (s)
13231307
{
1308+
/* Here we use non-lowercased string "recoded" */
1309+
s=recoded+ (s-pstr);
13241310
while (*s&& !t_isspace(s))
13251311
s+=pg_mblen(s);
13261312
while (*s&&t_isspace(s))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp