diff options
author | Matt A. Tobin <email@mattatobin.com> | 2019-11-10 18:13:59 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2019-11-10 18:13:59 -0500 |
commit | 1ec388b2383aa1540961843847d3af32174a248d (patch) | |
tree | 1ffbb71b43ae32b6ed158eb310643a0238584a98 /mailnews/mime/src | |
parent | 5393f033bcd3d9933c71b4beea4ff90f4e49accc (diff) | |
download | UXP-1ec388b2383aa1540961843847d3af32174a248d.tar UXP-1ec388b2383aa1540961843847d3af32174a248d.tar.gz UXP-1ec388b2383aa1540961843847d3af32174a248d.tar.lz UXP-1ec388b2383aa1540961843847d3af32174a248d.tar.xz UXP-1ec388b2383aa1540961843847d3af32174a248d.zip |
Bug 1227761 - Fix logic error in BuildAttachmentList().
First attachment cannot be saved if MIME message has no body part.
Tag #1273
Diffstat (limited to 'mailnews/mime/src')
-rw-r--r-- | mailnews/mime/src/mimemoz2.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/mailnews/mime/src/mimemoz2.cpp b/mailnews/mime/src/mimemoz2.cpp index 09ac52545..c47c5c8a5 100644 --- a/mailnews/mime/src/mimemoz2.cpp +++ b/mailnews/mime/src/mimemoz2.cpp @@ -529,13 +529,14 @@ BuildAttachmentList(MimeObject *anObject, nsMsgAttachmentData *aAttachData, cons skip = false; if (skip && child->headers) { - char * disp = MimeHeaders_get (child->headers, - HEADER_CONTENT_DISPOSITION, - true, false); - if (MimeHeaders_get_name(child->headers, nullptr) && - (!disp || PL_strcasecmp(disp, "attachment"))) - // it has a filename and isn't being displayed inline - skip = false; + // If it has a filename, we don't skip it regardless of the + // content disposition which can be "inline" or "attachment". + // Inline parts are not shown when attachments aren't displayed + // inline, so the only chance to see the part is as attachment. + char * name = MimeHeaders_get_name(child->headers, nullptr); + if (name) + skip = false; + PR_FREEIF(name); } found_output = true; |