/pidgin/main: b02b90cece86: gtkxfer: add 'file://' scheme to pur...

Jakub Adam jakub.adam at ktknet.cz
Sat Jun 18 22:10:08 EDT 2016

Changeset: b02b90cece86d5155382700b25422474d48b0891
Author:	 Jakub Adam <jakub.adam at ktknet.cz>
Date:	 2016-06-17 07:11 +0200
Branch:	 release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/b02b90cece86


gtkxfer: add 'file://' scheme to purple_notify_uri() argument

The argument should be a URI, so make sure what we pass is one.
Not doing so causes trouble when the filename contains spaces or special
characters which may get escaped:

'/tmp/some file.txt' turns into '/tmp/some%20file.txt' which for example
xdg-open treats as a different and likely non-existent file.
'file:///tmp/some%20file.txt' is still a valid file URI though.

Backport of Pidgin 3 commits d9798c40b7ec and 9ab6c9a03ae5.


 pidgin/gtkft.c |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (14 lines):

diff --git a/pidgin/gtkft.c b/pidgin/gtkft.c
--- a/pidgin/gtkft.c
+++ b/pidgin/gtkft.c
@@ -504,7 +504,9 @@ open_button_cb(GtkButton *button, Pidgin
-		purple_notify_uri(NULL, filename);
+		gchar *uri = g_strdup_printf("file://%s", filename);
+		purple_notify_uri(NULL, uri);
+		g_free(uri);

More information about the Commits mailing list