summaryrefslogtreecommitdiff
path: root/libdocument/ev-attachment.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdocument/ev-attachment.c')
-rw-r--r--libdocument/ev-attachment.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libdocument/ev-attachment.c b/libdocument/ev-attachment.c
index 26047819..6e7942ee 100644
--- a/libdocument/ev-attachment.c
+++ b/libdocument/ev-attachment.c
@@ -414,13 +414,16 @@ ev_attachment_open (EvAttachment *attachment,
retval = ev_attachment_launch_app (attachment, screen,
timestamp, error);
} else {
+ char *basename;
char *template;
GFile *file;
/* FIXMEchpe: convert to filename encoding first! */
- template = g_strdup_printf ("%s.XXXXXX", ev_attachment_get_name (attachment));
+ basename = g_path_get_basename (ev_attachment_get_name (attachment));
+ template = g_strdup_printf ("%s.XXXXXX", basename);
file = ev_mkstemp_file (template, error);
g_free (template);
+ g_free (basename);
if (file != NULL && ev_attachment_save (attachment, file, error)) {
if (attachment->priv->tmp_file)