mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-14 06:18:34 +00:00
don't create directories when checking for game options, only create when the user selects the menu entry
This commit is contained in:
parent
fc821fc5b4
commit
14cd4af752
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user