mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 18:40:09 +00:00
More logial ordering.
This commit is contained in:
parent
c0f436b8ab
commit
088b01b52e
@ -195,7 +195,26 @@ static void add_sub_conf(config_file_t *conf, char *line)
|
|||||||
|
|
||||||
char real_path[MAXPATHLEN];
|
char real_path[MAXPATHLEN];
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifdef _WIN32
|
||||||
|
// Accomodate POSIX systems on Win32.
|
||||||
|
bool is_full_path = *path == '/';
|
||||||
|
|
||||||
|
if (is_full_path)
|
||||||
|
strlcpy(real_path, path, sizeof(real_path));
|
||||||
|
else
|
||||||
|
GetFullPathNameA(path, sizeof(real_path), real_path, NULL);
|
||||||
|
|
||||||
|
if (strcmp(path, real_path) != 0)
|
||||||
|
{
|
||||||
|
strlcpy(real_path, conf->path, sizeof(real_path));
|
||||||
|
char *split = strrchr(real_path, '/');
|
||||||
|
if (!split)
|
||||||
|
split = strrchr(real_path, '\\');
|
||||||
|
|
||||||
|
split[1] = '\0';
|
||||||
|
strlcat(real_path, path, sizeof(real_path));
|
||||||
|
}
|
||||||
|
#else
|
||||||
if (*path == '/')
|
if (*path == '/')
|
||||||
{
|
{
|
||||||
strlcpy(real_path, path, sizeof(real_path));
|
strlcpy(real_path, path, sizeof(real_path));
|
||||||
@ -218,25 +237,6 @@ static void add_sub_conf(config_file_t *conf, char *line)
|
|||||||
else
|
else
|
||||||
strlcpy(real_path, path, sizeof(real_path));
|
strlcpy(real_path, path, sizeof(real_path));
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
// Accomodate POSIX systems on Win32.
|
|
||||||
bool is_full_path = *path == '/';
|
|
||||||
|
|
||||||
if (is_full_path)
|
|
||||||
strlcpy(real_path, path, sizeof(real_path));
|
|
||||||
else
|
|
||||||
GetFullPathNameA(path, sizeof(real_path), real_path, NULL);
|
|
||||||
|
|
||||||
if (strcmp(path, real_path) != 0)
|
|
||||||
{
|
|
||||||
strlcpy(real_path, conf->path, sizeof(real_path));
|
|
||||||
char *split = strrchr(real_path, '/');
|
|
||||||
if (!split)
|
|
||||||
split = strrchr(real_path, '\\');
|
|
||||||
|
|
||||||
split[1] = '\0';
|
|
||||||
strlcat(real_path, path, sizeof(real_path));
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
config_file_t *sub_conf = config_file_new_internal(real_path, conf->include_depth + 1);
|
config_file_t *sub_conf = config_file_new_internal(real_path, conf->include_depth + 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user