]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch-show.c
Merge branch 'release'
[notmuch] / notmuch-show.c
index e05480899b33e9cfbc3809f37e9e8c2b6cc8b3de..22fa655ad20d8deea55297af4616c2cec7e292d0 100644 (file)
@@ -13,7 +13,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see http://www.gnu.org/licenses/ .
+ * along with this program.  If not, see https://www.gnu.org/licenses/ .
  *
  * Author: Carl Worth <cworth@cworth.org>
  */
@@ -456,7 +456,8 @@ format_part_text (const void *ctx, sprinter_t *sp, mime_node_t *node,
            g_mime_part_get_filename (GMIME_PART (node->part)) : NULL;
 
        if (disposition &&
-           strcmp (disposition->disposition, GMIME_DISPOSITION_ATTACHMENT) == 0)
+           strcasecmp (g_mime_content_disposition_get_disposition (disposition),
+                       GMIME_DISPOSITION_ATTACHMENT) == 0)
            part_type = "attachment";
        else
            part_type = "part";
@@ -896,9 +897,14 @@ do_show_single (void *ctx,
     notmuch_messages_t *messages;
     notmuch_message_t *message;
     notmuch_status_t status;
+    unsigned int count;
 
-    if (notmuch_query_count_messages (query) != 1) {
-       fprintf (stderr, "Error: search term did not match precisely one message.\n");
+    status = notmuch_query_count_messages_st (query, &count);
+    if (print_status_query ("notmuch show", query, status))
+       return 1;
+
+    if (count != 1) {
+       fprintf (stderr, "Error: search term did not match precisely one message (matched %d messages).\n", count);
        return 1;
     }