Skip to content

Commit

Permalink
Remove reference to non-existing entry in FILENAMES:
Browse files Browse the repository at this point in the history
An entry with key "legacy_fontlist" is never created, the lookup for it will yield an empty string.
Open an empty path will always fail, so the then-block is never run.

Therefor this removes that dead code completely.
  • Loading branch information
BevapDin committed Nov 17, 2019
1 parent 127694b commit 02c6f96
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/sdltiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3266,21 +3266,8 @@ static cata::optional<std::string> find_system_font( const std::string &name, in
const std::string fontlist_path = FILENAMES["fontlist"];
std::ifstream fin( fontlist_path.c_str() );
if( !fin.is_open() ) {
// Try opening the fontlist at the old location.
fin.open( FILENAMES["legacy_fontlist"].c_str() );
if( !fin.is_open() ) {
dbg( D_INFO ) << "Generating fontlist";
assure_dir_exist( FILENAMES["config_dir"] );
save_font_list();
fin.open( fontlist_path.c_str() );
if( !fin ) {
dbg( D_ERROR ) << "Can't open or create fontlist file " << fontlist_path;
return cata::nullopt;
}
} else {
// Write out fontlist to the new location.
save_font_list();
}
// Write out fontlist to the new location.
save_font_list();
}
if( fin.is_open() ) {
std::string fname;
Expand Down

0 comments on commit 02c6f96

Please sign in to comment.