aboutsummaryrefslogtreecommitdiff
path: root/src/compose.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-12-26 06:44:48 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-12-26 06:44:48 +0000
commit624978fc2ac911e5daac08905a8d6e5c62e53694 (patch)
treee2a98ce6db76c5aca34d471e3e307478c4669fdb /src/compose.c
parent81e59201385b28d3c6690f48f031d090acc0de31 (diff)
don't traverse inside message/rfc822 to avoid duplicated attachments.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@863 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/compose.c')
-rw-r--r--src/compose.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/compose.c b/src/compose.c
index 7b463bb3..f430f2ea 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -1980,19 +1980,19 @@ static void compose_attach_parts(Compose *compose, MsgInfo *msginfo)
infile = procmsg_get_message_file_path(msginfo);
- for (child = mimeinfo; child != NULL;
- child = procmime_mimeinfo_next(child)) {
+ child = mimeinfo;
+ while (child != NULL) {
if (child->children || child->mime_type == MIME_MULTIPART)
- continue;
+ goto next;
if (child->mime_type != MIME_MESSAGE_RFC822 &&
!child->filename && !child->name)
- continue;
+ goto next;
outfile = procmime_get_tmp_file_name(child);
if (procmime_get_part(outfile, infile, child) < 0) {
g_warning(_("Can't get the part of multipart message."));
g_free(outfile);
- continue;
+ goto next;
}
compose_attach_append
@@ -2001,6 +2001,12 @@ static void compose_attach_parts(Compose *compose, MsgInfo *msginfo)
child->content_type);
g_free(outfile);
+
+next:
+ if (child->mime_type == MIME_MESSAGE_RFC822)
+ child = child->next;
+ else
+ child = procmime_mimeinfo_next(child);
}
g_free(infile);