Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyifang committed Dec 26, 2024
1 parent fc2351e commit 940909f
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/dict/stardict.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1658,25 +1658,17 @@ static void findCorrespondingFiles( string const & ifo, string & idx, string & d
{
string base( ifo, 0, ifo.size() - 3 );

vector< string > idxFiles =
{ base + "idx", base + "idx.gz", base + "idx.dz", base + "IDX", base + "IDX.GZ", base + "IDX.DZ" };

auto ret = Utils::Fs::anyExistingFile( idxFiles );
auto ret = Utils::Fs::anyExistingFile( { base + "idx", base + "idx.gz", base + "idx.dz", base + "IDX", base + "IDX.GZ", base + "IDX.DZ" } );
if ( !ret ) {
throw exNoIdxFile( ifo );
}

vector< string > dictFiles = { base + "dict", base + "dict.dz", base + "DICT", base + "dict.DZ" };

ret = Utils::Fs::anyExistingFile( dictFiles );
ret = Utils::Fs::anyExistingFile( { base + "dict", base + "dict.dz", base + "DICT", base + "dict.DZ" } );
if ( !ret ) {
throw exNoDictFile( ifo );
}

vector< string > synFiles =
{ base + "syn", base + "syn.gz", base + "syn.dz", base + "SYN", base + "SYN.GZ", base + "SYN.DZ" };

ret = Utils::Fs::anyExistingFile( synFiles );
ret = Utils::Fs::anyExistingFile( { base + "syn", base + "syn.gz", base + "syn.dz", base + "SYN", base + "SYN.GZ", base + "SYN.DZ" } );

if ( !ret ) {
syn.clear();
Expand Down

0 comments on commit 940909f

Please sign in to comment.