diff options
author | Shaun McCance <shaunm@gnome.org> | 2010-03-19 14:34:37 -0500 |
---|---|---|
committer | Shaun McCance <shaunm@gnome.org> | 2010-03-19 14:34:37 -0500 |
commit | d03d4b79169fbec0a74ac387fca32a012f232f0e (patch) | |
tree | 65ba0e2fdb5d82ad080296151a19d640c8a4691f | |
parent | c64413773989cd0f2e25c2313d83d5d19e148b14 (diff) | |
download | yelp-d03d4b79169fbec0a74ac387fca32a012f232f0e.tar.gz |
[yelp-application] Resolve relative path before LoadURI over DBus
-rw-r--r-- | src/yelp-application.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/yelp-application.c b/src/yelp-application.c index 5c473864..d908f574 100644 --- a/src/yelp-application.c +++ b/src/yelp-application.c @@ -207,7 +207,16 @@ yelp_application_run (YelpApplication *app, request == DBUS_REQUEST_NAME_REPLY_IN_QUEUE) { gchar *newuri; - newuri = g_strdup (uri); + if (uri && (strchr (uri, ':') || (uri[0] == '/'))) + newuri = uri; + else { + GFile *base, *new; + gchar *cur = g_get_current_dir (); + base = g_file_new_for_path (cur); + new = g_file_resolve_relative_path (base, uri); + newuri = g_file_get_uri (new); + g_free (cur); + } proxy = dbus_g_proxy_new_for_name (priv->connection, "org.gnome.Yelp", @@ -222,7 +231,8 @@ yelp_application_run (YelpApplication *app, g_error_free (error); } - g_free (newuri); + if (newuri != uri) + g_free (newuri); g_object_unref (proxy); return 1; } |