diff --git a/src/common/utils.cc b/src/common/utils.cc index c052c17a..b431e2fd 100644 --- a/src/common/utils.cc +++ b/src/common/utils.cc @@ -30,7 +30,8 @@ std::string c_string( const QString & str ) bool endsWithIgnoreCase( QByteArrayView str, QByteArrayView extension ) { - return ( str.size() >= extension.size() ) && str.last( extension.size() ).compare( extension, Qt::CaseInsensitive ); + return ( str.size() >= extension.size() ) + && ( str.last( extension.size() ).compare( extension, Qt::CaseInsensitive ) == 0 ); } QString escapeAmps( QString const & str ) diff --git a/src/dict/dsl.cc b/src/dict/dsl.cc index 43907b31..f5aef6de 100644 --- a/src/dict/dsl.cc +++ b/src/dict/dsl.cc @@ -1736,7 +1736,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & f // Make sure it's not an abbreviation file. extSize of ".dsl" or ".dsl.dz" if ( int extSize = ( uncompressedDsl ? 4 : 7 ); ( fileName.size() >= ( 5 + extSize ) ) - && QByteArrayView( fileName ).chopped( extSize ).last( 5 ).compare( "_abrv", Qt::CaseInsensitive ) ) { + && ( QByteArrayView( fileName ).chopped( extSize ).last( 5 ).compare( "_abrv", Qt::CaseInsensitive ) == 0 ) ) { // It is, skip it continue; } diff --git a/src/langcoder.cc b/src/langcoder.cc index 5f2029c3..04a3c093 100644 --- a/src/langcoder.cc +++ b/src/langcoder.cc @@ -231,7 +231,7 @@ quint32 LangCoder::findIdForLanguage( gd::wstring const & lang ) const auto langFolded = QByteArrayView( Utf8::encode( lang ) ); for ( auto const & lc : LANG_CODE_MAP ) { - if ( langFolded.compare( lc.lang, Qt::CaseInsensitive ) ) { + if ( langFolded.compare( lc.lang, Qt::CaseInsensitive ) == 0 ) { return code2toInt( lc.code2.toStdString().c_str() ); } }