@ -458,6 +458,8 @@ IsAffixFlagInUse(IspellDict *Conf, int affix, const char *affixflag)
if ( * affixflag = = 0 )
if ( * affixflag = = 0 )
return true ;
return true ;
Assert ( affix < Conf - > nAffixData ) ;
flagcur = Conf - > AffixData [ affix ] ;
flagcur = Conf - > AffixData [ affix ] ;
while ( * flagcur )
while ( * flagcur )
@ -1160,13 +1162,17 @@ getAffixFlagSet(IspellDict *Conf, char *s)
( errcode ( ERRCODE_CONFIG_FILE_ERROR ) ,
( errcode ( ERRCODE_CONFIG_FILE_ERROR ) ,
errmsg ( " invalid affix alias \" %s \" " , s ) ) ) ;
errmsg ( " invalid affix alias \" %s \" " , s ) ) ) ;
if ( curaffix > 0 & & curaffix < = Conf - > nAffixData )
if ( curaffix > 0 & & curaffix < Conf - > nAffixData )
/*
/*
* Do not subtract 1 from curaffix because empty string was added
* Do not subtract 1 from curaffix because empty string was added
* in NIImportOOAffixes
* in NIImportOOAffixes
*/
*/
return Conf - > AffixData [ curaffix ] ;
return Conf - > AffixData [ curaffix ] ;
else if ( curaffix > Conf - > nAffixData )
ereport ( ERROR ,
( errcode ( ERRCODE_CONFIG_FILE_ERROR ) ,
errmsg ( " invalid affix alias \" %s \" " , s ) ) ) ;
else
else
return VoidString ;
return VoidString ;
}
}
@ -1561,6 +1567,8 @@ MergeAffix(IspellDict *Conf, int a1, int a2)
{
{
char * * ptr ;
char * * ptr ;
Assert ( a1 < Conf - > nAffixData & & a2 < Conf - > nAffixData ) ;
/* Do not merge affix flags if one of affix flags is empty */
/* Do not merge affix flags if one of affix flags is empty */
if ( * Conf - > AffixData [ a1 ] = = ' \0 ' )
if ( * Conf - > AffixData [ a1 ] = = ' \0 ' )
return a2 ;
return a2 ;
@ -1603,9 +1611,10 @@ MergeAffix(IspellDict *Conf, int a1, int a2)
static uint32
static uint32
makeCompoundFlags ( IspellDict * Conf , int affix )
makeCompoundFlags ( IspellDict * Conf , int affix )
{
{
char * str = Conf - > AffixData [ affix ] ;
Assert ( affix < Conf - > nAffixData ) ;
return ( getCompoundAffixFlagValue ( Conf , str ) & FF_COMPOUNDFLAGMASK ) ;
return ( getCompoundAffixFlagValue ( Conf , Conf - > AffixData [ affix ] ) &
FF_COMPOUNDFLAGMASK ) ;
}
}
/*
/*
@ -1725,6 +1734,16 @@ NISortDictionary(IspellDict *Conf)
( errcode ( ERRCODE_CONFIG_FILE_ERROR ) ,
( errcode ( ERRCODE_CONFIG_FILE_ERROR ) ,
errmsg ( " invalid affix alias \" %s \" " ,
errmsg ( " invalid affix alias \" %s \" " ,
Conf - > Spell [ i ] - > p . flag ) ) ) ;
Conf - > Spell [ i ] - > p . flag ) ) ) ;
if ( curaffix < 0 | | curaffix > = Conf - > nAffixData )
ereport ( ERROR ,
( errcode ( ERRCODE_CONFIG_FILE_ERROR ) ,
errmsg ( " invalid affix alias \" %s \" " ,
Conf - > Spell [ i ] - > p . flag ) ) ) ;
if ( * end ! = ' \0 ' & & ! t_isdigit ( end ) & & ! t_isspace ( end ) )
ereport ( ERROR ,
( errcode ( ERRCODE_CONFIG_FILE_ERROR ) ,
errmsg ( " invalid affix alias \" %s \" " ,
Conf - > Spell [ i ] - > p . flag ) ) ) ;
}
}
else
else
{
{