Use g_build_filename

Instead of manual path construction. Pointed out by Cosimo.
This commit is contained in:
Matthias Clasen 2016-07-06 19:33:20 -04:00
parent 5090920c98
commit f08b703f84

View File

@ -28,7 +28,7 @@ glib_should_use_portal (void)
const char *use_portal; const char *use_portal;
char *path; char *path;
path = g_strdup_printf ("%s/flatpak-info", g_get_user_runtime_dir ()); path = g_build_filename (g_get_user_runtime_dir (), "flatpak-info", NULL);
if (g_file_test (path, G_FILE_TEST_EXISTS)) if (g_file_test (path, G_FILE_TEST_EXISTS))
use_portal = "1"; use_portal = "1";
else else
@ -49,8 +49,7 @@ glib_network_available_in_sandbox (void)
GKeyFile *keyfile; GKeyFile *keyfile;
gboolean available = TRUE; gboolean available = TRUE;
path = g_strdup_printf ("%s/flatpak-info", g_get_user_runtime_dir ()); path = g_build_filename (g_get_user_runtime_dir (), "flatpak-info", NULL);
keyfile = g_key_file_new (); keyfile = g_key_file_new ();
if (g_key_file_load_from_file (keyfile, path, G_KEY_FILE_NONE, NULL)) if (g_key_file_load_from_file (keyfile, path, G_KEY_FILE_NONE, NULL))
{ {