diff options
author | Jakub Adam <jakub.adam@ktknet.cz> | 2016-06-17 07:11:46 +0200 |
---|---|---|
committer | Jakub Adam <jakub.adam@ktknet.cz> | 2016-06-17 07:11:46 +0200 |
commit | dee3c51418685556679148cb80f657df8d5fb09c (patch) | |
tree | ebc710c7e45ff6faec1fc8e958ad1a0da01f6ff2 | |
parent | c4033a0f464d2baa976f118d614d4863b161d392 (diff) | |
download | pidgin-dee3c51418685556679148cb80f657df8d5fb09c.tar.gz |
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.
-rw-r--r-- | pidgin/gtkft.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pidgin/gtkft.c b/pidgin/gtkft.c index b000b0489c..e67ad7b598 100644 --- a/pidgin/gtkft.c +++ b/pidgin/gtkft.c @@ -504,7 +504,9 @@ open_button_cb(GtkButton *button, PidginXferDialog *dialog) } else { - purple_notify_uri(NULL, filename); + gchar *uri = g_strdup_printf("file://%s", filename); + purple_notify_uri(NULL, uri); + g_free(uri); return; } |