From 5004113ce15aa9d5fbdbd84ad453582fd0d7fa88 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 5 Jun 2016 18:27:31 +0200 Subject: [PATCH] Cleanup --- retroarch.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/retroarch.c b/retroarch.c index 3481b4045d..57c4e1d037 100644 --- a/retroarch.c +++ b/retroarch.c @@ -391,27 +391,14 @@ static void retroarch_set_special_paths(char **argv, unsigned num_content) } } -const char *retroarch_get_current_savefile_dir(void) +static void retroarch_set_paths_redirect(void) { - char *ret = current_savefile_dir; - - /* try to infer the path in case it's still empty by calling - set_paths_redirect */ - if (string_is_empty(ret)) - rarch_ctl(RARCH_CTL_SET_PATHS_REDIRECT, NULL); - RARCH_LOG("Environ SAVE_DIRECTORY: \"%s\".\n", ret); - - return ret; -} - -static void retroarch_set_paths_redirect() -{ - char current_savestate_dir[PATH_MAX_LENGTH]; - uint32_t global_library_name_hash = 0; - bool check_global_library_name_hash = false; - global_t *global = global_get_ptr(); - settings_t *settings = config_get_ptr(); - rarch_system_info_t *info = NULL; + char current_savestate_dir[PATH_MAX_LENGTH] = {0}; + uint32_t global_library_name_hash = 0; + bool check_global_library_name_hash = false; + global_t *global = global_get_ptr(); + settings_t *settings = config_get_ptr(); + rarch_system_info_t *info = NULL; runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &info); @@ -544,6 +531,19 @@ static void retroarch_set_paths_redirect() } } +const char *retroarch_get_current_savefile_dir(void) +{ + char *ret = current_savefile_dir; + + /* try to infer the path in case it's still empty by calling + set_paths_redirect */ + if (string_is_empty(ret) && !content_does_not_need_content()) + retroarch_set_paths_redirect(); + + return ret; +} + + enum rarch_content_type retroarch_path_is_media_type(const char *path) { uint32_t hash_ext = msg_hash_calculate(path_get_extension(path));