7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $PostgreSQL: pgsql/src/backend/tsearch/spell.c,v 1.3 2007/09/1010:39:56 teodor Exp $
10
+ * $PostgreSQL: pgsql/src/backend/tsearch/spell.c,v 1.4 2007/09/1020:27:12 teodor Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -647,12 +647,10 @@ NIImportOOAffixes(IspellDict * Conf, const char *filename)
647
647
gotonextline ;
648
648
flag = * sflag ;
649
649
isSuffix = (STRNCMP (ptype ,"sfx" )== 0 ) ? true : false;
650
- pfind = lowerstr_ctx (find );
651
- if (t_iseq (find ,'y' ))
650
+ if (t_iseq (find ,'y' )|| t_iseq (find ,'Y' ))
652
651
flagflags = FF_CROSSPRODUCT ;
653
652
else
654
653
flagflags = 0 ;
655
- pfree (pfind );
656
654
}
657
655
else
658
656
{
@@ -666,7 +664,7 @@ NIImportOOAffixes(IspellDict * Conf, const char *filename)
666
664
if ((ptr = strchr (prepl ,'/' ))!= NULL )
667
665
{
668
666
* ptr = '\0' ;
669
- ptr ++ ;
667
+ ptr = repl + ( ptr - prepl ) + 1 ;
670
668
while (* ptr )
671
669
{
672
670
aflg |=Conf -> flagval [(unsignedint )* ptr ];
@@ -704,8 +702,7 @@ NIImportOOAffixes(IspellDict * Conf, const char *filename)
704
702
void
705
703
NIImportAffixes (IspellDict * Conf ,const char * filename )
706
704
{
707
- char str [BUFSIZ ],
708
- * pstr = NULL ;
705
+ char * pstr = NULL ;
709
706
char mask [BUFSIZ ];
710
707
char find [BUFSIZ ];
711
708
char repl [BUFSIZ ];
@@ -742,13 +739,15 @@ NIImportAffixes(IspellDict * Conf, const char *filename)
742
739
743
740
if (STRNCMP (pstr ,"compoundwords" )== 0 )
744
741
{
745
- s = findchar (str ,'l' );
742
+ s = findchar (pstr ,'l' );
746
743
if (s )
747
744
{
745
+ s = recoded + (s - pstr );/* we need non-lowercased string */
748
746
while (* s && !t_isspace (s ))
749
747
s ++ ;
750
748
while (* s && t_isspace (s ))
751
749
s ++ ;
750
+
752
751
if (* s && pg_mblen (s )== 1 )
753
752
{
754
753
Conf -> flagval [(unsignedint )* s ]= FF_COMPOUNDFLAG ;
@@ -774,7 +773,7 @@ NIImportAffixes(IspellDict * Conf, const char *filename)
774
773
}
775
774
if (STRNCMP (pstr ,"flag" )== 0 )
776
775
{
777
- s = str + 4 ;
776
+ s = recoded + 4 ;/* we need non-lowercased string */
778
777
flagflags = 0 ;
779
778
780
779
while (* s && t_isspace (s ))
@@ -1333,7 +1332,7 @@ addToResult(char **forms, char **cur, char *word)
1333
1332
}
1334
1333
1335
1334
static char * *
1336
- NormalizeSubWord (IspellDict * Conf ,char * word ,char flag )
1335
+ NormalizeSubWord (IspellDict * Conf ,char * word ,int flag )
1337
1336
{
1338
1337
AffixNodeData * suffix = NULL ,
1339
1338
* prefix = NULL ;