@@ -216,19 +216,6 @@ findchar(char *str, int c)
216
216
return NULL ;
217
217
}
218
218
219
- static char *
220
- findchar2 (char * str ,int c1 ,int c2 )
221
- {
222
- while (* str )
223
- {
224
- if (t_iseq (str ,c1 )|| t_iseq (str ,c2 ))
225
- return str ;
226
- str += pg_mblen (str );
227
- }
228
-
229
- return NULL ;
230
- }
231
-
232
219
233
220
/* backward string compare for suffix tree operations */
234
221
static int
@@ -1233,8 +1220,9 @@ NIImportOOAffixes(IspellDict *Conf, const char *filename)
1233
1220
1234
1221
if (flag == 0 )
1235
1222
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 )
1238
1226
{
1239
1227
/*
1240
1228
* Here we use non-lowercased string "repl". We need position
@@ -1244,10 +1232,6 @@ NIImportOOAffixes(IspellDict *Conf, const char *filename)
1244
1232
ptr = repl + (ptr - prepl )+ 1 ;
1245
1233
aflg |=getFlagValues (Conf ,getFlags (Conf ,ptr ));
1246
1234
}
1247
- /* Get lowercased version of string before '/' */
1248
- prepl = lowerstr_ctx (Conf ,repl );
1249
- if ((ptr = strchr (prepl ,'/' ))!= NULL )
1250
- * ptr = '\0' ;
1251
1235
pfind = lowerstr_ctx (Conf ,find );
1252
1236
pmask = lowerstr_ctx (Conf ,mask );
1253
1237
if (t_iseq (find ,'0' ))
@@ -1317,10 +1301,12 @@ NIImportAffixes(IspellDict *Conf, const char *filename)
1317
1301
1318
1302
if (STRNCMP (pstr ,"compoundwords" )== 0 )
1319
1303
{
1320
- /* Findcase-insensitive L flag innon- lowercased string */
1321
- s = findchar2 ( recoded ,'l' , 'L ' );
1304
+ /* Findposition in lowercased string "pstr" */
1305
+ s = findchar ( pstr ,'l' );
1322
1306
if (s )
1323
1307
{
1308
+ /* Here we use non-lowercased string "recoded" */
1309
+ s = recoded + (s - pstr );
1324
1310
while (* s && !t_isspace (s ))
1325
1311
s += pg_mblen (s );
1326
1312
while (* s && t_isspace (s ))