mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 04:24:09 +00:00
Fix isNameOf...() functions for case of string contains whitespaces only
This commit is contained in:
parent
9468f266f5
commit
ad705bd01e
|
@ -27,6 +27,9 @@ string simplifyString( string const & str )
|
||||||
while( endPos && Utf8::isspace( str[ endPos - 1 ] ) )
|
while( endPos && Utf8::isspace( str[ endPos - 1 ] ) )
|
||||||
--endPos;
|
--endPos;
|
||||||
|
|
||||||
|
if( endPos <= beginPos )
|
||||||
|
return string();
|
||||||
|
|
||||||
result.reserve( endPos - beginPos );
|
result.reserve( endPos - beginPos );
|
||||||
|
|
||||||
while( beginPos < endPos )
|
while( beginPos < endPos )
|
||||||
|
|
Loading…
Reference in a new issue