Merge pull request #7821 from fr500/master

try to fix #7811
This commit is contained in:
Twinaphex 2018-12-26 04:46:05 +01:00 committed by GitHub
commit 8845b674fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -1562,8 +1562,6 @@ static void frontend_unix_get_env(int *argc,
{
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_ASSETS], app_dir,
"assets", sizeof(g_defaults.dirs[DEFAULT_DIR_ASSETS]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CACHE], app_dir,
"tmp", sizeof(g_defaults.dirs[DEFAULT_DIR_CACHE]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SHADER], app_dir,
"shaders", sizeof(g_defaults.dirs[DEFAULT_DIR_SHADER]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_OVERLAY], app_dir,
@ -1628,6 +1626,10 @@ static void frontend_unix_get_env(int *argc,
internal_storage_app_path, "cheats",
sizeof(g_defaults.dirs[DEFAULT_DIR_CHEATS]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CACHE],
internal_storage_app_path, "temp",
sizeof(g_defaults.dirs[DEFAULT_DIR_CACHE]));
if(!string_is_empty(screenshot_dir)
&& test_permissions(screenshot_dir))
{
@ -1686,6 +1688,10 @@ static void frontend_unix_get_env(int *argc,
app_dir, "cheats",
sizeof(g_defaults.dirs[DEFAULT_DIR_CHEATS]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CACHE],
app_dir, "temp",
sizeof(g_defaults.dirs[DEFAULT_DIR_CACHE]));
if( !string_is_empty(screenshot_dir)
&& test_permissions(screenshot_dir))
{
@ -1749,6 +1755,10 @@ static void frontend_unix_get_env(int *argc,
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CHEATS],
internal_storage_path, "RetroArch/cheats",
sizeof(g_defaults.dirs[DEFAULT_DIR_CHEATS]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CACHE],
internal_storage_path, "temp",
sizeof(g_defaults.dirs[DEFAULT_DIR_CACHE]));
default:
break;
}

View File

@ -18,6 +18,7 @@
#include "mem_util.h"
#include "../core.h"
#include "../configuration.h"
#include "../dynamic.h"
#include "../paths.h"
#include "../content.h"
@ -50,6 +51,7 @@ void clear_controller_port_map(void);
static char *get_temp_directory_alloc(void)
{
settings_t *settings = config_get_ptr();
char *path = NULL;
#ifdef _WIN32
#ifdef LEGACY_WIN32
@ -67,6 +69,8 @@ static char *get_temp_directory_alloc(void)
path = utf16_to_utf8_string_alloc(wideStr);
free(wideStr);
#endif
#elif defined ANDROID
path = strcpy_alloc_force(settings->paths.directory_libretro);
#else
path = "/tmp";
if (getenv("TMPDIR"))