From 02c6f96dcca2c3373329e3f03c7b44c552304ac1 Mon Sep 17 00:00:00 2001 From: BevapDin Date: Sat, 9 Nov 2019 19:37:08 +0100 Subject: [PATCH] Remove reference to non-existing entry in FILENAMES: 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. --- src/sdltiles.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp index 08b41e19940cf..1e43f62a6520f 100644 --- a/src/sdltiles.cpp +++ b/src/sdltiles.cpp @@ -3266,21 +3266,8 @@ static cata::optional 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;