From 14cd4af752fc4b658b3745c9b9920d8364d7550d Mon Sep 17 00:00:00 2001 From: radius Date: Mon, 8 Feb 2016 00:07:41 -0500 Subject: [PATCH] don't create directories when checking for game options, only create when the user selects the menu entry --- menu/cbs/menu_cbs_ok.c | 2 +- retroarch.c | 5 +++-- retroarch.h | 2 +- runloop.c | 4 +--- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index ca0d060aa9..88b5e1812b 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -1535,7 +1535,7 @@ static int action_ok_option_create(const char *path, rarch_system_info_t *system = NULL; config_file_t *conf = NULL; - if (!rarch_option_create(game_path, sizeof(game_path))) + if (!rarch_game_options_validate(game_path, sizeof(game_path), true)) { menu_display_msg_queue_push("Error saving core options file", 1, 100, true); diff --git a/retroarch.c b/retroarch.c index 7b7f1b8312..978a94b2bc 100644 --- a/retroarch.c +++ b/retroarch.c @@ -1113,7 +1113,7 @@ static bool init_state(void) return true; } -bool rarch_option_create(char *s, size_t len) +bool rarch_game_options_validate(char *s, size_t len, bool mkdir) { char core_path[PATH_MAX_LENGTH]; char config_directory[PATH_MAX_LENGTH]; @@ -1153,7 +1153,8 @@ bool rarch_option_create(char *s, size_t len) fill_pathname_join(core_path, config_directory, core_name, sizeof(core_path)); - if (!path_is_directory(core_path)) + + if (!path_is_directory(core_path) && mkdir) path_mkdir(core_path); return true; diff --git a/retroarch.h b/retroarch.h index 31042687f6..04fe534379 100644 --- a/retroarch.h +++ b/retroarch.h @@ -172,7 +172,7 @@ enum rarch_content_type rarch_path_is_media_type(const char *path); const char *rarch_get_current_savefile_dir(void); -bool rarch_option_create(char *s, size_t len); +bool rarch_game_options_validate(char *s, size_t len, bool mkdir); #ifdef __cplusplus } diff --git a/runloop.c b/runloop.c index 6cf1084243..655141d7e5 100644 --- a/runloop.c +++ b/runloop.c @@ -386,8 +386,6 @@ static void check_shader_dir(rarch_dir_list_t *dir_list, /** * rarch_game_specific_options: * - * Environment callback function implementation. - * * Returns: true (1) if a game specific core * options path has been found, * otherwise false (0). @@ -397,7 +395,7 @@ static bool rarch_game_specific_options(char **output) char game_path[PATH_MAX_LENGTH]; config_file_t *option_file = NULL; - if (!rarch_option_create(game_path, sizeof(game_path))) + if (!rarch_game_options_validate(game_path, sizeof(game_path), false)) return false; option_file = config_file_new(game_path);