[PATCH 1/2] lib: content disposition values are not case-sensitive

Subject:[PATCH 1/2] lib: content disposition values are not case-sensitive

Date:Sat, 26 Sep 2015 12:35:21 +0300

To:David Bremner ,Johannes Schauer ,notmuch@notmuchmail.org

Cc:

From:Jani Nikula


Per RFC 2183, the values for Content-Disposition values are not
case-sensitive. While at it, use the gmime function for getting at the
disposition string instead of referencing the field directly.

This fixes "attachment" tagging and filename term generation for
attachments while indexing.
---
 lib/index.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/index.cc b/lib/index.cc
index e81aa8190288..f166aefd2fc1 100644
--- a/lib/index.cc
+++ b/lib/index.cc
@@ -377,7 +377,8 @@ _index_mime_part (notmuch_message_t *message,
 
     disposition = g_mime_object_get_content_disposition (part);
     if (disposition &&
-	strcmp (disposition->disposition, GMIME_DISPOSITION_ATTACHMENT) == 0)
+	strcasecmp (g_mime_content_disposition_get_disposition (disposition),
+		    GMIME_DISPOSITION_ATTACHMENT) == 0)
     {
 	const char *filename = g_mime_part_get_filename (GMIME_PART (part));
 
-- 
2.1.4


Thread: