[balsa/gtk3] Use only the basename of an attachment's filename
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/gtk3] Use only the basename of an attachment's filename
- Date: Mon, 21 Sep 2015 19:08:30 +0000 (UTC)
commit c7d1b7fd85fc64443707f9c96398ee6eecba1503
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Mon Sep 21 15:07:29 2015 -0400
Use only the basename of an attachment's filename
* libbalsa/body.c (libbalsa_message_body_save_temporary): use
only the basename of an attachment's filename.
ChangeLog | 5 +++++
libbalsa/body.c | 7 ++++++-
2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8919ec0..f8e9a2a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-09-21 Peter Bloomfield <pbloomfield bellsouth net>
+
+ * libbalsa/body.c (libbalsa_message_body_save_temporary): use
+ only the basename of an attachment's filename.
+
2015-07-23 Peter Bloomfield <pbloomfield bellsouth net>
Fix the image-loading option for HTML message parts
diff --git a/libbalsa/body.c b/libbalsa/body.c
index bac3c66..f6f3e54 100644
--- a/libbalsa/body.c
+++ b/libbalsa/body.c
@@ -366,8 +366,13 @@ libbalsa_message_body_save_temporary(LibBalsaMessageBody * body, GError **err)
LIBBALSA_MAILBOX_TEMPDIR_ERROR,
"Failed to create temporary directory");
} else {
+ gchar *basename;
+
+ basename = g_path_get_basename(filename);
body->temp_filename =
- g_build_filename(tempdir, filename, NULL);
+ g_build_filename(tempdir, basename, NULL);
+ g_free(basename);
+
fd = open(body->temp_filename,
O_WRONLY | O_EXCL | O_CREAT,
S_IRUSR);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]