mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
fix: dsl dictionary crash when skip expandOptionalParts as headword is too long
This commit is contained in:
parent
2b9b278e83
commit
40f67d7f0f
7
dsl.cc
7
dsl.cc
|
@ -2153,10 +2153,9 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
|
|||
|
||||
hasString = false;
|
||||
|
||||
// The line read should either consist of pure whitespace, or be a
|
||||
// headword
|
||||
|
||||
if ( curString.empty() )
|
||||
// The line read should either consist of pure whitespace, or be a headword
|
||||
// skip too long headword,it can never be headword.
|
||||
if( curString.empty() || curString.size() > 100 )
|
||||
continue;
|
||||
|
||||
if ( isDslWs( curString[ 0 ] ) )
|
||||
|
|
|
@ -1155,12 +1155,6 @@ void expandOptionalParts( wstring & str, list< wstring > * result,
|
|||
list< wstring > * headwords;
|
||||
headwords = inside_recurse ? result : &expanded;
|
||||
|
||||
//if str is too long ,it can never be headwords.
|
||||
//todo?
|
||||
if( str.size() > 100 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
for( ; x < str.size(); )
|
||||
{
|
||||
wchar ch = str[ x ];
|
||||
|
|
Loading…
Reference in a new issue