mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-30 13:24:05 +00:00
DSL: Fix freezes on some incorrect dictionaries
This commit is contained in:
parent
661dd4d140
commit
7e1063f22e
|
@ -1286,6 +1286,13 @@ void processUnsortedParts( wstring & str, bool strip )
|
|||
void expandOptionalParts( wstring & str, list< wstring > * result,
|
||||
size_t x, bool inside_recurse )
|
||||
{
|
||||
if( str.size() > 500 )
|
||||
{
|
||||
// Don't expand too long headwords - it is highly likely incorrect dictionary
|
||||
result->push_back( str );
|
||||
return;
|
||||
}
|
||||
|
||||
list< wstring > expanded;
|
||||
list< wstring > * headwords;
|
||||
headwords = inside_recurse ? result : &expanded;
|
||||
|
|
Loading…
Reference in a new issue