diff --git a/paths.c b/paths.c index 600335268e..5abe56fbb6 100644 --- a/paths.c +++ b/paths.c @@ -44,6 +44,7 @@ static char current_savefile_dir[PATH_MAX_LENGTH] = {0}; static char path_libretro[PATH_MAX_LENGTH] = {0}; +static char path_config_file[PATH_MAX_LENGTH] = {0}; void path_set_redirect(void) { @@ -447,9 +448,7 @@ void path_clear_core(void) bool path_is_config_empty(void) { - global_t *global = global_get_ptr(); - - if (global && string_is_empty(global->path.config)) + if (string_is_empty(path_config_file)) return true; return false; @@ -460,21 +459,22 @@ void path_set_config(const char *path) global_t *global = global_get_ptr(); if (!global) return; - strlcpy(global->path.config, path, sizeof(global->path.config)); + strlcpy(path_config_file, path, sizeof(path_config_file)); } const char *path_get_config(void) { if (!path_is_config_empty()) - { - global_t *global = global_get_ptr(); - if (global) - return global->path.config; - } + return path_config_file; return NULL; } +void path_clear_config(void) +{ + *path_config_file = '\0'; +} + bool path_is_core_options_empty(void) { global_t *global = global_get_ptr(); @@ -516,7 +516,8 @@ const char *path_get_core_options(void) void path_clear_all(void) { global_t *global = global_get_ptr(); - + + path_clear_config(); path_clear_core(); path_clear_core_options(); diff --git a/paths.h b/paths.h index e0d897f33d..8c5c631f20 100644 --- a/paths.h +++ b/paths.h @@ -59,6 +59,8 @@ bool path_is_core_options_empty(void); void path_clear_core(void); +void path_clear_config(void); + void path_clear_core_options(void); void path_clear_all(void); diff --git a/runloop.h b/runloop.h index b3920a9d85..29c273dc50 100644 --- a/runloop.h +++ b/runloop.h @@ -157,7 +157,6 @@ typedef struct rarch_path char bsx_rom[PATH_MAX_LENGTH]; char sufami_rom[2][PATH_MAX_LENGTH]; /* Config associated with global "default" config. */ - char config[PATH_MAX_LENGTH]; char append_config[PATH_MAX_LENGTH]; char input_config[PATH_MAX_LENGTH]; #ifdef HAVE_FILE_LOGGER