Use config_file_exists

This commit is contained in:
twinaphex 2016-09-18 21:57:51 +02:00
parent d25cace9ed
commit 80d577094c
2 changed files with 6 additions and 13 deletions

View file

@ -118,12 +118,9 @@ static void find_and_set_first_file(char *s, size_t len,
static void salamander_init(char *s, size_t len) static void salamander_init(char *s, size_t len)
{ {
/* normal executable loading path */ /* normal executable loading path */
bool config_file_exists = false; bool config_exists = config_file_exists(g_defaults.path.config);
if (path_file_exists(g_defaults.path.config)) if (config_exists)
config_file_exists = true;
if (config_file_exists)
{ {
char tmp_str[PATH_MAX_LENGTH]; char tmp_str[PATH_MAX_LENGTH];
config_file_t * conf = (config_file_t*)config_file_new(g_defaults.path.config); config_file_t * conf = (config_file_t*)config_file_new(g_defaults.path.config);
@ -141,12 +138,12 @@ static void salamander_init(char *s, size_t len)
* the file is there when it doesn't. */ * the file is there when it doesn't. */
else else
{ {
config_file_exists = false; config_exists = false;
} }
#endif #endif
} }
if (!config_file_exists || string_is_equal(s, "")) if (!config_exists || string_is_equal(s, ""))
{ {
char executable_name[PATH_MAX_LENGTH]; char executable_name[PATH_MAX_LENGTH];
@ -157,7 +154,7 @@ static void salamander_init(char *s, size_t len)
else else
RARCH_LOG("Start [%s] found in retroarch.cfg.\n", s); RARCH_LOG("Start [%s] found in retroarch.cfg.\n", s);
if (!config_file_exists) if (!config_exists)
{ {
config_file_t *conf = (config_file_t*)config_file_new(NULL); config_file_t *conf = (config_file_t*)config_file_new(NULL);

View file

@ -507,18 +507,14 @@ static void runloop_check_shader_dir(
static bool rarch_game_specific_options(char **output) static bool rarch_game_specific_options(char **output)
{ {
char game_path[PATH_MAX_LENGTH] = {0}; char game_path[PATH_MAX_LENGTH] = {0};
config_file_t *option_file = NULL;
if (!retroarch_validate_game_options(game_path, if (!retroarch_validate_game_options(game_path,
sizeof(game_path), false)) sizeof(game_path), false))
return false; return false;
option_file = config_file_new(game_path); if (!config_file_exists(game_path))
if (!option_file)
return false; return false;
config_file_free(option_file);
RARCH_LOG("%s %s\n", RARCH_LOG("%s %s\n",
msg_hash_to_str(MSG_GAME_SPECIFIC_CORE_OPTIONS_FOUND_AT), msg_hash_to_str(MSG_GAME_SPECIFIC_CORE_OPTIONS_FOUND_AT),
game_path); game_path);