From 506b81679a883d2a96bcd17e7c826a3166bdf82e Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Sat, 26 Sep 2015 12:35:21 +0300 Subject: [PATCH] lib: content disposition values are not case-sensitive 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 ++- test/T190-multipart.sh | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/index.cc b/lib/index.cc index e81aa819..f166aefd 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)); diff --git a/test/T190-multipart.sh b/test/T190-multipart.sh index 1caf6831..35678909 100755 --- a/test/T190-multipart.sh +++ b/test/T190-multipart.sh @@ -764,7 +764,6 @@ output=$(notmuch search from:todd and mimetype:multipart/alternative | notmuch_s test_expect_equal "$output" "thread:XXX 2014-01-12 [1/1] Todd; odd content types (inbox unread)" test_begin_subtest "case of Content-Disposition doesn't matter for indexing" -test_subtest_known_broken cat < ${MAIL_DIR}/content-disposition Return-path: Envelope-to: david@tethera.net -- 2.43.0