[glib/portal] Use g_build_filename
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/portal] Use g_build_filename
- Date: Wed, 6 Jul 2016 23:52:35 +0000 (UTC)
commit f08b703f844dddf79bd6196368e04bfd0013b77e
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Jul 6 19:33:20 2016 -0400
Use g_build_filename
Instead of manual path construction. Pointed out by Cosimo.
gio/gportalsupport.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gio/gportalsupport.c b/gio/gportalsupport.c
index 635daa3..9eab046 100644
--- a/gio/gportalsupport.c
+++ b/gio/gportalsupport.c
@@ -28,7 +28,7 @@ glib_should_use_portal (void)
const char *use_portal;
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))
use_portal = "1";
else
@@ -49,8 +49,7 @@ glib_network_available_in_sandbox (void)
GKeyFile *keyfile;
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 ();
if (g_key_file_load_from_file (keyfile, path, G_KEY_FILE_NONE, NULL))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]