=================================================================== RCS file: /cvsroot/aspell/aspell/modules/speller/default/language.cpp,v retrieving revision 1.58 diff -u -r1.58 language.cpp --- modules/speller/default/language.cpp 21 Nov 2004 02:52:23 -0000 1.58 +++ modules/speller/default/language.cpp 17 Dec 2004 08:21:28 -0000 @@ -299,7 +299,7 @@ break; } } - repls_.resize(num_repl); + if (num_repl > 0) have_repl_ = true; @@ -309,10 +309,21 @@ ::to_lower(d.key); assert(d.key == "rep"); // FIXME split(d); - repls_[i].substr = buf_.dup(iconv(d.key)); - to_clean((char *)repls_[i].substr, repls_[i].substr); - repls_[i].repl = buf_.dup(iconv(d.value)); - to_clean((char *)repls_[i].repl, repls_[i].repl); + SuggestRepl rep; + rep.substr = buf_.dup(iconv(d.key)); + if (check_if_valid(*this, rep.substr).get_err()) + continue; // FIXME: This should probably be an error, but + // this may cause problems with compatibility with + // Myspell as these entries may make sense for + // Myspell (but obviously not for Aspell) + to_clean((char *)rep.substr, rep.substr); + rep.repl = buf_.dup(iconv(d.value)); + if (check_if_valid(*this, rep.repl).get_err()) + continue; // FIXME: Ditto + to_clean((char *)rep.repl, rep.repl); + if (strcmp(rep.substr, rep.repl) == 0 || rep.substr[0] == '\0') + continue; // FIXME: Ditto + repls_.push_back(rep); } }