mirror of
https://github.com/libretro/RetroArch
synced 2025-01-26 18:35:22 +00:00
Some Windows fixes.
This commit is contained in:
parent
9eb14e328d
commit
80925ffc11
@ -26,6 +26,9 @@
|
|||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#include <sys/param.h> // MAXPATHLEN
|
#include <sys/param.h> // MAXPATHLEN
|
||||||
|
#else
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MAXPATHLEN
|
#ifndef MAXPATHLEN
|
||||||
@ -215,11 +218,30 @@ static void add_sub_conf(config_file_t *conf, char *line)
|
|||||||
strlcpy(real_path, path, sizeof(real_path));
|
strlcpy(real_path, path, sizeof(real_path));
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
GetFullPathNameA(path, sizeof(real_path), real_path, NULL);
|
// 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
|
||||||
|
|
||||||
|
printf("Path = %s\n", real_path);
|
||||||
|
|
||||||
config_file_t *sub_conf = config_file_new_internal(real_path, true);
|
config_file_t *sub_conf = config_file_new_internal(real_path, true);
|
||||||
if (!conf)
|
if (!sub_conf)
|
||||||
{
|
{
|
||||||
free(path);
|
free(path);
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user