Add provisions for portable mode to global dir functions

This commit is contained in:
David Hrdlička
2025-08-24 20:49:16 +02:00
committed by GitHub
parent 1b2aa32c67
commit 156d6f8bc8
4 changed files with 56 additions and 26 deletions

View File

@@ -875,19 +875,21 @@ plat_init_rom_paths(void)
void
plat_get_global_config_dir(char *outbuf, const size_t len)
{
char *prefPath = SDL_GetPrefPath(NULL, "86Box");
strncpy(outbuf, prefPath, len);
path_slash(outbuf);
SDL_free(prefPath);
return plat_get_global_data_dir(outbuf, len);
}
void
plat_get_global_data_dir(char *outbuf, const size_t len)
{
char *prefPath = SDL_GetPrefPath(NULL, "86Box");
strncpy(outbuf, prefPath, len);
if (portable_mode) {
strncpy(outbuf, exe_path, len);
} else {
char *prefPath = SDL_GetPrefPath(NULL, "86Box");
strncpy(outbuf, prefPath, len);
SDL_free(prefPath);
}
path_slash(outbuf);
SDL_free(prefPath);
}
void