/pidgin/main: d9798c40b7ec: gtkxfer: add 'file://' scheme to pur...
Jakub Adam
jakub.adam at ktknet.cz
Tue May 24 20:09:14 EDT 2016
Changeset: d9798c40b7ec54cad061f563ff4bd3a2f8ae5f8a
Author: Jakub Adam <jakub.adam at ktknet.cz>
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;
}
More information about the Commits
mailing list