diff --git a/console/rarch_console_config.c b/console/rarch_console_config.c index 9a0a91d50e..4deb6308b6 100644 --- a/console/rarch_console_config.c +++ b/console/rarch_console_config.c @@ -21,12 +21,12 @@ #include "rarch_console_config.h" -void rarch_config_load(const char * conf_name, const char * libretro_dir_path, const char * exe_ext, bool find_libretro_path) +void rarch_config_load(const char * conf_name, const char * libretro_dir_path, const char * exe_ext, bool upgrade_core_succeeded) { char libretro_path_tmp[PATH_MAX]; //if a core has been upgraded, settings need to saved at the end - if(!find_libretro_path) + if(upgrade_core_succeeded) snprintf(libretro_path_tmp, sizeof(libretro_path_tmp), g_settings.libretro); @@ -116,7 +116,7 @@ void rarch_config_load(const char * conf_name, const char * libretro_dir_path, c CONFIG_GET_INT_EXTERN(state_slot, "state_slot"); CONFIG_GET_INT_EXTERN(audio_data.mute, "audio_mute"); - if(!find_libretro_path) + if(upgrade_core_succeeded) { //save config file with new libretro path snprintf(g_settings.libretro, sizeof(g_settings.libretro), libretro_path_tmp); diff --git a/console/rarch_console_config.h b/console/rarch_console_config.h index 6d010ac50e..56343382d0 100644 --- a/console/rarch_console_config.h +++ b/console/rarch_console_config.h @@ -24,7 +24,7 @@ enum INPUT_PRESET_FILE }; -void rarch_config_load(const char * conf_name, const char * libretro_dir_path, const char * exe_ext, bool find_libretro_path); +void rarch_config_load(const char * conf_name, const char * libretro_dir_path, const char * exe_ext, bool upgrade_core_succeeded); void rarch_config_save(const char * conf_name); #endif diff --git a/console/rarch_console_libretro_mgmt.c b/console/rarch_console_libretro_mgmt.c index 16c94be61e..dc0e9ec3d1 100644 --- a/console/rarch_console_libretro_mgmt.c +++ b/console/rarch_console_libretro_mgmt.c @@ -57,7 +57,7 @@ void rarch_console_name_from_id(char *name, size_t size) bool rarch_configure_libretro_core(const char *core_exe_path, const char *tmp_path, const char *libretro_path, const char *config_path, const char *extension) { - bool find_libretro_file = false; + bool upgrade_core_succeeded = false; g_extern.verbose = true; @@ -93,18 +93,18 @@ bool rarch_configure_libretro_core(const char *core_exe_path, const char *tmp_pa { RARCH_LOG("libretro core [%s] renamed to: [%s].\n", core_exe_path, tmp_pathnewfile); snprintf(g_settings.libretro, sizeof(g_settings.libretro), tmp_pathnewfile); + upgrade_core_succeeded = true; } else { RARCH_ERR("Failed to rename CORE executable.\n"); RARCH_WARN("CORE executable was not found, or some other error occurred. Will attempt to load libretro core path from config file.\n"); - find_libretro_file = true; } } g_extern.verbose = false; - return find_libretro_file; + return upgrade_core_succeeded; } bool rarch_manage_libretro_extension_supported(const char *filename)