From 5acd615cfe5272dd11ebce3ec34321fec0124071 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 3 Mar 2009 19:03:20 +0000 Subject: =?UTF-8?q?Bug=20561172=20=E2=80=93=20gnome-open=20fails=20on=20lo?= =?UTF-8?q?cal=20URIs=20with=20anchors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2009-03-03 Alexander Larsson Bug 561172 – gnome-open fails on local URIs with anchors * programs/gvfs-open.c: Don't pass file:// uris with anchor as filename svn path=/trunk/; revision=2283 --- ChangeLog | 7 +++++++ programs/gvfs-open.c | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9be0dc2e..b4db7ac3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-03-03 Alexander Larsson + + Bug 561172 – gnome-open fails on local URIs with anchors + + * programs/gvfs-open.c: + Don't pass file:// uris with anchor as filename + 2009-03-03 Alexander Larsson * client/gdaemonfileinputstream.c: diff --git a/programs/gvfs-open.c b/programs/gvfs-open.c index 26efa5f0..1f734b8c 100644 --- a/programs/gvfs-open.c +++ b/programs/gvfs-open.c @@ -38,6 +38,15 @@ static GOptionEntry entries[] = { {NULL} }; +static gboolean +is_file_uri_with_anchor (char *str) +{ + if (g_ascii_strncasecmp (str, "file:", 5) == 0 && + strchr (str, '#') != NULL) + return TRUE; + return FALSE; +} + static void open (GFile *file, char *arg_string) { @@ -59,7 +68,7 @@ open (GFile *file, char *arg_string) return; } - if (g_file_is_native (file)) + if (g_file_is_native (file) && !is_file_uri_with_anchor (arg_string)) { /* For normal files, pass in the canonicalized GFile as path */ l.data = file; -- cgit v1.2.1