77 *
88 *
99 * 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 $
1111 *
1212 *-------------------------------------------------------------------------
1313 */
@@ -647,12 +647,10 @@ NIImportOOAffixes(IspellDict * Conf, const char *filename)
647647gotonextline ;
648648flag = * sflag ;
649649isSuffix = (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' ))
652651flagflags = FF_CROSSPRODUCT ;
653652else
654653flagflags = 0 ;
655- pfree (pfind );
656654}
657655else
658656{
@@ -666,7 +664,7 @@ NIImportOOAffixes(IspellDict * Conf, const char *filename)
666664if ((ptr = strchr (prepl ,'/' ))!= NULL )
667665{
668666* ptr = '\0' ;
669- ptr ++ ;
667+ ptr = repl + ( ptr - prepl ) + 1 ;
670668while (* ptr )
671669{
672670aflg |=Conf -> flagval [(unsignedint )* ptr ];
@@ -704,8 +702,7 @@ NIImportOOAffixes(IspellDict * Conf, const char *filename)
704702void
705703NIImportAffixes (IspellDict * Conf ,const char * filename )
706704{
707- char str [BUFSIZ ],
708- * pstr = NULL ;
705+ char * pstr = NULL ;
709706char mask [BUFSIZ ];
710707char find [BUFSIZ ];
711708char repl [BUFSIZ ];
@@ -742,13 +739,15 @@ NIImportAffixes(IspellDict * Conf, const char *filename)
742739
743740if (STRNCMP (pstr ,"compoundwords" )== 0 )
744741{
745- s = findchar (str ,'l' );
742+ s = findchar (pstr ,'l' );
746743if (s )
747744{
745+ s = recoded + (s - pstr );/* we need non-lowercased string */
748746while (* s && !t_isspace (s ))
749747s ++ ;
750748while (* s && t_isspace (s ))
751749s ++ ;
750+
752751if (* s && pg_mblen (s )== 1 )
753752{
754753Conf -> flagval [(unsignedint )* s ]= FF_COMPOUNDFLAG ;
@@ -774,7 +773,7 @@ NIImportAffixes(IspellDict * Conf, const char *filename)
774773}
775774if (STRNCMP (pstr ,"flag" )== 0 )
776775{
777- s = str + 4 ;
776+ s = recoded + 4 ;/* we need non-lowercased string */
778777flagflags = 0 ;
779778
780779while (* s && t_isspace (s ))
@@ -1333,7 +1332,7 @@ addToResult(char **forms, char **cur, char *word)
13331332}
13341333
13351334static char * *
1336- NormalizeSubWord (IspellDict * Conf ,char * word ,char flag )
1335+ NormalizeSubWord (IspellDict * Conf ,char * word ,int flag )
13371336{
13381337AffixNodeData * suffix = NULL ,
13391338* prefix = NULL ;