summaryrefslogtreecommitdiff
path: root/programs
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2009-03-03 19:03:20 +0000
committerAlexander Larsson <alexl@src.gnome.org>2009-03-03 19:03:20 +0000
commit5acd615cfe5272dd11ebce3ec34321fec0124071 (patch)
tree083944d001402b21fb06597af938e95e81f12261 /programs
parent5838b96c55de01abb76a9e3b0c52858d3462fa10 (diff)
downloadgvfs-5acd615cfe5272dd11ebce3ec34321fec0124071.tar.gz
Bug 561172 – gnome-open fails on local URIs with anchors
2009-03-03 Alexander Larsson <alexl@redhat.com> 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
Diffstat (limited to 'programs')
-rw-r--r--programs/gvfs-open.c11
1 files changed, 10 insertions, 1 deletions
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;