Cleanups
This commit is contained in:
parent
22bd770571
commit
3aea25479c
34
command.c
34
command.c
|
@ -1451,27 +1451,21 @@ static bool command_event_save_auto_state(void)
|
||||||
static bool command_event_save_config(const char *config_path,
|
static bool command_event_save_config(const char *config_path,
|
||||||
char *s, size_t len)
|
char *s, size_t len)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
if (config_save_file(config_path))
|
||||||
|
|
||||||
if (config_path)
|
|
||||||
ret = config_save_file(config_path);
|
|
||||||
|
|
||||||
if (ret)
|
|
||||||
{
|
{
|
||||||
snprintf(s, len, "%s \"%s\".",
|
snprintf(s, len, "%s \"%s\".",
|
||||||
msg_hash_to_str(MSG_SAVED_NEW_CONFIG_TO),
|
msg_hash_to_str(MSG_SAVED_NEW_CONFIG_TO),
|
||||||
path_get_config());
|
path_get_config());
|
||||||
RARCH_LOG("%s\n", s);
|
RARCH_LOG("%s\n", s);
|
||||||
}
|
return true;
|
||||||
else
|
|
||||||
{
|
|
||||||
snprintf(s, len, "%s \"%s\".",
|
|
||||||
msg_hash_to_str(MSG_FAILED_SAVING_CONFIG_TO),
|
|
||||||
path_get_config());
|
|
||||||
RARCH_ERR("%s\n", s);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
snprintf(s, len, "%s \"%s\".",
|
||||||
|
msg_hash_to_str(MSG_FAILED_SAVING_CONFIG_TO),
|
||||||
|
path_get_config());
|
||||||
|
RARCH_ERR("%s\n", s);
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1606,16 +1600,12 @@ void command_event_save_current_config(int override_type)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
|
/* Save last core-specific config to the default config location,
|
||||||
|
* needed on consoles for core switching and reusing last good
|
||||||
|
* config for new cores.
|
||||||
|
*/
|
||||||
if (settings->config_save_on_exit && !path_is_config_empty())
|
if (settings->config_save_on_exit && !path_is_config_empty())
|
||||||
{
|
|
||||||
/* Save last core-specific config to the default config location,
|
|
||||||
* needed on consoles for core switching and reusing last good
|
|
||||||
* config for new cores.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Flush out the core specific config. */
|
|
||||||
command_event_save_config(path_get_config(), msg, sizeof(msg));
|
command_event_save_config(path_get_config(), msg, sizeof(msg));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string_is_empty(msg))
|
if (!string_is_empty(msg))
|
||||||
|
|
Loading…
Reference in New Issue