mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
Fall back to global system dir if content path is empty when 'System Files are in Content Directory' is enabled (#16175)
This commit is contained in:
parent
633dad5d6b
commit
9e6b790f19
@ -727,12 +727,22 @@ static int menu_displaylist_parse_core_info(
|
||||
strlcpy(tmp_path, path_get(RARCH_PATH_CONTENT), sizeof(tmp_path));
|
||||
path_basedir(tmp_path);
|
||||
|
||||
/* Removes trailing slash, doesn't really matter but it's more consistent with how
|
||||
* the path is stored and displayed without 'System Files are in Content Directory' */
|
||||
len = strlen(tmp_path);
|
||||
if (tmp_path[len - 1] == PATH_DEFAULT_SLASH_C())
|
||||
tmp_path[len - 1] = '\0';
|
||||
firmware_info.directory.system = tmp_path;
|
||||
/* If content path is empty, fall back to global system dir path */
|
||||
if (string_is_empty(tmp_path))
|
||||
firmware_info.directory.system = settings->paths.directory_system;
|
||||
else
|
||||
{
|
||||
size_t len = strlen(tmp_path);
|
||||
|
||||
/* Removes trailing slash (unless root dir), doesn't really matter
|
||||
* but it's more consistent with how the path is stored and
|
||||
* displayed without 'System Files are in Content Directory' */
|
||||
if ( string_count_occurrences_single_character(tmp_path, PATH_DEFAULT_SLASH_C()) > 1
|
||||
&& tmp_path[len - 1] == PATH_DEFAULT_SLASH_C())
|
||||
tmp_path[len - 1] = '\0';
|
||||
|
||||
firmware_info.directory.system = tmp_path;
|
||||
}
|
||||
}
|
||||
else
|
||||
firmware_info.directory.system = settings->paths.directory_system;
|
||||
|
@ -1981,15 +1981,18 @@ bool runloop_environment_cb(unsigned cmd, void *data)
|
||||
strlcpy(tmp_path, fullpath, sizeof(tmp_path));
|
||||
path_basedir(tmp_path);
|
||||
|
||||
/* Removes trailing slash */
|
||||
/* Removes trailing slash (unless root dir) */
|
||||
len = strlen(tmp_path);
|
||||
if (tmp_path[len - 1] == PATH_DEFAULT_SLASH_C())
|
||||
if ( string_count_occurrences_single_character(tmp_path, PATH_DEFAULT_SLASH_C()) > 1
|
||||
&& tmp_path[len - 1] == PATH_DEFAULT_SLASH_C())
|
||||
tmp_path[len - 1] = '\0';
|
||||
|
||||
dir_set(RARCH_DIR_SYSTEM, tmp_path);
|
||||
*(const char**)data = dir_get_ptr(RARCH_DIR_SYSTEM);
|
||||
}
|
||||
else /* If content path is empty, fall back to global system dir path */
|
||||
*(const char**)data = dir_system;
|
||||
|
||||
*(const char**)data = dir_get_ptr(RARCH_DIR_SYSTEM);
|
||||
RARCH_LOG("[Environ]: SYSTEM_DIRECTORY: \"%s\".\n",
|
||||
*(const char**)data);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user