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

        * gdesktopappinfo.c:
	Don't force uris to filenames if the uri has an anchor, because
	that would strip the anchor.

        * glocalvfs.c:
	Strip anchor from file:// uris when creating GFile, since
	g_filename_from_uri doesn't handle them.



svn path=/trunk/; revision=7953
This commit is contained in:
Alexander Larsson
2009-03-03 19:02:16 +00:00
committed by Alexander Larsson
parent f891d4e04e
commit 896c3d1b2c
3 changed files with 44 additions and 10 deletions

View File

@@ -31,6 +31,7 @@
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
#include <string.h>
#include "gioalias.h"
@@ -90,9 +91,22 @@ g_local_vfs_get_file_for_uri (GVfs *vfs,
{
char *path;
GFile *file;
char *stripped_uri, *hash;
if (strchr (uri, '#') != NULL)
{
stripped_uri = g_strdup (uri);
hash = strchr (stripped_uri, '#');
*hash = 0;
}
else
stripped_uri = (char *)uri;
path = g_filename_from_uri (stripped_uri, NULL, NULL);
path = g_filename_from_uri (uri, NULL, NULL);
if (stripped_uri != uri)
g_free (stripped_uri);
if (path != NULL)
file = _g_local_file_new (path);
else