diff options
Diffstat (limited to 'libdocument')
-rw-r--r-- | libdocument/ev-attachment.c | 5 |
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) |