(Platform unix) Updates

This commit is contained in:
twinaphex 2019-09-18 03:37:25 +02:00
parent 698387e762
commit 1ced1b3f73
2 changed files with 19 additions and 9 deletions

View File

@ -144,10 +144,13 @@ int system_property_get(const char *command,
char buffer[PATH_MAX_LENGTH] = {0};
char cmd[PATH_MAX_LENGTH] = {0};
char *curpos = NULL;
size_t copied = strlcpy(cmd, command, sizeof(cmd));
snprintf(cmd, sizeof(cmd), "%s %s", command, args);
string_add_space_fast(cmd, copied);
pipe = popen(cmd, "r");
copied = strlcat(cmd, args, sizeof(cmd));
pipe = popen(cmd, "r");
if (!pipe)
goto error;
@ -1689,13 +1692,21 @@ static void frontend_unix_get_env(int *argc,
const char *home = getenv("HOME");
if (xdg)
snprintf(base_path, sizeof(base_path),
"%s/retroarch", xdg);
{
size_t copied = strlcpy(base_path, xdg, sizeof(base_path));
string_add_backslash_fast(base_path, copied);
copied = strlcat(base_path, "retroarch", sizeof(base_path));
}
else if (home)
snprintf(base_path, sizeof(base_path),
"%s/.config/retroarch", home);
{
size_t copied = strlcpy(base_path, home, sizeof(base_path));
string_add_backslash_fast(base_path, copied);
copied = strlcat(base_path, ".config", sizeof(base_path));
string_add_backslash_fast(base_path, copied);
copied = strlcat(base_path, "retroarch", sizeof(base_path));
}
else
snprintf(base_path, sizeof(base_path), "retroarch");
strlcpy(base_path, "retroarch", sizeof(base_path));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE], base_path,
"cores", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE]));

View File

@ -554,8 +554,7 @@ static void frontend_win32_environment_get(int *argc, char *argv[],
":\\logs", sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
#ifdef HAVE_MENU
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGL1) || defined(HAVE_OPENGLES) || defined(HAVE_OPENGL_CORE)
snprintf(g_defaults.settings.menu,
sizeof(g_defaults.settings.menu), "xmb");
strlcpy(g_defaults.settings.menu, "xmb", sizeof(g_defaults.settings.menu));
#endif
#endif
}