X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=hdrline.c;h=2ba1266f8f93b22604a8d60e4fbca2d0442249cf;hp=d120175aa57faa7ebcb019ad1160e8ade8a65b6d;hb=c6b9d35ed9361e4defab9762a7480d5126405ae9;hpb=d6988dab6bd378ccdf0f17aaa16de8aee1ceaf43 diff --git a/hdrline.c b/hdrline.c index d120175..2ba1266 100644 --- a/hdrline.c +++ b/hdrline.c @@ -20,7 +20,7 @@ #include "mutt_idna.h" #include "mime.h" -#include "lib/str.h" +#include #include "lib/rx.h" #include @@ -48,7 +48,7 @@ int mutt_is_subscribed_list (ADDRESS * addr) * return 1. Otherwise, simply return 0. */ static int -check_for_mailing_list (ADDRESS * adr, char *pfx, char *buf, int buflen) +check_for_mailing_list (ADDRESS * adr, const char *pfx, char *buf, int buflen) { for (; adr; adr = adr->next) { if (mutt_is_subscribed_list (adr)) { @@ -590,7 +590,7 @@ static const char *hdr_format_str (char *dest, snprintf (dest, destlen, fmt, (Tochars && ((i = mutt_user_is_recipient (hdr))) < - str_len (Tochars)) ? Tochars[i] : ' '); + m_strlen(Tochars)) ? Tochars[i] : ' '); break; case 'u': @@ -633,14 +633,12 @@ static const char *hdr_format_str (char *dest, case 'X': { - int count, flags = 0; - - if (hdr->content->parts) - count = mutt_count_body_parts(hdr, flags); - else { - mutt_parse_mime_message(ctx, hdr); - count = mutt_count_body_parts(hdr, flags); - mutt_free_body(&hdr->content->parts); + int count = 0; + + if (option (OPTCOUNTATTACH)) { + if (!hdr->content->parts) + mutt_parse_mime_message(ctx, hdr); + count = mutt_count_body_parts(hdr, 0); } /* The recursion allows messages without depth to return 0. */ @@ -683,7 +681,7 @@ static const char *hdr_format_str (char *dest, ((i = mutt_user_is_recipient (hdr)) < - str_len (Tochars)) ? + m_strlen(Tochars)) ? Tochars[i] : ' '))); mutt_format_s (dest, destlen, prefix, buf2); break;