From 16ab373503bffcd3fcc591807b602eebe94df477 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Wed, 24 Jul 2013 17:11:21 +0000 Subject: [PATCH] (trunk gtk) #5320 'can't opena folder with '#' in its name': in gtr_open_file(), use g_file_new_for_path(). --- gtk/util.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/gtk/util.c b/gtk/util.c index 3f5180591..fe83f9ef4 100644 --- a/gtk/util.c +++ b/gtk/util.c @@ -361,21 +361,11 @@ gtr_get_help_uri (void) void gtr_open_file (const char * path) { - char * uri; - - if (g_path_is_absolute (path)) - { - uri = g_strdup_printf ("file://%s", path); - } - else - { - char * cwd = g_get_current_dir (); - uri = g_strdup_printf ("file://%s/%s", cwd, path); - g_free (cwd); - } - + GFile * file = g_file_new_for_path (path); + gchar * uri = g_file_get_uri (file); gtr_open_uri (uri); g_free (uri); + g_object_unref (file); } void