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

Jakub Adam <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: d9798c40b7ec54cad061f563ff4bd3a2f8ae5f8a
Author:	 Jakub Adam <[email protected]>
Date:	 2016-05-12 08:16 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/d9798c40b7ec

Description:

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.

diffstat:

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

diffs (14 lines):

diff --git a/pidgin/gtkxfer.c b/pidgin/gtkxfer.c
--- a/pidgin/gtkxfer.c
+++ b/pidgin/gtkxfer.c
@@ -508,7 +508,9 @@ open_button_cb(GtkButton *button, Pidgin
 	}
 	else
 	{
-		purple_notify_uri(NULL, filename);
+		char *uri = g_strdup_printf("file://%s", filename);
+		purple_notify_uri(NULL, uri);
+		g_free(uri);
 		return;
 	}
 

_______________________________________________
Commits mailing list
[email protected]
https://pidgin.im/cgi-bin/mailman/listinfo/commits
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.