mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 08:30:16 +00:00
Rewrite command_event_save_config
This commit is contained in:
parent
3bda00edaf
commit
096686140d
39
command.c
39
command.c
@ -1374,29 +1374,32 @@ error:
|
||||
return false;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
if (string_is_empty(config_path) || !config_save_file(config_path))
|
||||
bool path_exists = !string_is_empty(config_path);
|
||||
const char *str = path_exists ? config_path :
|
||||
path_get(RARCH_PATH_CONFIG);
|
||||
|
||||
if (path_exists && config_save_file(config_path))
|
||||
{
|
||||
const char *str = path_get(RARCH_PATH_CONFIG);
|
||||
|
||||
if (!string_is_empty(str))
|
||||
{
|
||||
snprintf(s, len, "%s \"%s\".",
|
||||
msg_hash_to_str(MSG_FAILED_SAVING_CONFIG_TO),
|
||||
str);
|
||||
RARCH_ERR("%s\n", s);
|
||||
}
|
||||
|
||||
return false;
|
||||
snprintf(s, len, "[Config]: %s \"%s\".",
|
||||
msg_hash_to_str(MSG_SAVED_NEW_CONFIG_TO),
|
||||
config_path);
|
||||
RARCH_LOG("%s\n", s);
|
||||
return true;
|
||||
}
|
||||
|
||||
snprintf(s, len, "[Config]: %s \"%s\".",
|
||||
msg_hash_to_str(MSG_SAVED_NEW_CONFIG_TO),
|
||||
config_path);
|
||||
RARCH_LOG("%s\n", s);
|
||||
return true;
|
||||
if (!string_is_empty(str))
|
||||
{
|
||||
snprintf(s, len, "%s \"%s\".",
|
||||
msg_hash_to_str(MSG_FAILED_SAVING_CONFIG_TO),
|
||||
str);
|
||||
RARCH_ERR("%s\n", s);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -20,6 +20,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <compat/strl.h>
|
||||
|
Loading…
Reference in New Issue
Block a user