From: Jani Nikula Date: Sat, 26 Sep 2015 09:35:21 +0000 (+0300) Subject: lib: content disposition values are not case-sensitive X-Git-Tag: 0.22_rc0~105 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=506b81679a883d2a96bcd17e7c826a3166bdf82e;hp=c1c955786ae1a828f09fd49d7b996dce624ee682 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. --- 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