From 197d39c13fb4cc5e316ecf5b2dcf981d7d71c512 Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Wed, 8 Nov 2006 02:08:00 +0100 Subject: [PATCH] last rewrite in rfc822parse.c Signed-off-by: Pierre Habouzit --- lib-mime/mime.h | 2 +- lib-mime/rfc822parse.c | 27 ++++++++++++++------------- protos.h | 1 - 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib-mime/mime.h b/lib-mime/mime.h index 8c0d3b8..30e5453 100644 --- a/lib-mime/mime.h +++ b/lib-mime/mime.h @@ -68,8 +68,8 @@ BODY *mutt_parse_messageRFC822(FILE *, BODY *); BODY *mutt_parse_multipart(FILE *, const char *, off_t, int); LIST **mutt_parse_rfc822_line(ENVELOPE *, HEADER *, char *line, char *p, short weed, short do_2047, LIST **); - ENVELOPE *mutt_read_rfc822_header(FILE *, HEADER *, short, short); +int mutt_count_body_parts (HEADER *hdr, int flags); /*** addresses ***/ diff --git a/lib-mime/rfc822parse.c b/lib-mime/rfc822parse.c index ceef3cc..ff8d822 100644 --- a/lib-mime/rfc822parse.c +++ b/lib-mime/rfc822parse.c @@ -1203,8 +1203,6 @@ static int count_body_parts_check(LIST **checklist, BODY *b) return 0; } -/* -------------------- XXX: MC READ MARK ------------- */ - static int count_body_parts (BODY *body, int flags) { int count = 0; @@ -1260,17 +1258,20 @@ static int count_body_parts (BODY *body, int flags) return count; } -int mutt_count_body_parts (HEADER *hdr, int flags) { - if (!option (OPTCOUNTATTACH)) - return (0); - if (hdr->attach_valid && !(flags & M_PARTS_RECOUNT)) - return hdr->attach_total; +int mutt_count_body_parts(HEADER *hdr, int flags) +{ + if (!option(OPTCOUNTATTACH)) + return 0; + + if (hdr->attach_valid && !(flags & M_PARTS_RECOUNT)) + return hdr->attach_total; - if (AttachAllow || AttachExclude || InlineAllow || InlineExclude) - hdr->attach_total = count_body_parts(hdr->content, flags | M_PARTS_TOPLEVEL); - else - hdr->attach_total = 0; + if (AttachAllow || AttachExclude || InlineAllow || InlineExclude) + hdr->attach_total = count_body_parts(hdr->content, + flags | M_PARTS_TOPLEVEL); + else + hdr->attach_total = 0; - hdr->attach_valid = 1; - return hdr->attach_total; + hdr->attach_valid = 1; + return hdr->attach_total; } diff --git a/protos.h b/protos.h index ee55845..8148476 100644 --- a/protos.h +++ b/protos.h @@ -104,7 +104,6 @@ void mutt_block_signals (void); void mutt_block_signals_system (void); int mutt_bounce_message (FILE * fp, HEADER *, address_t *); void mutt_canonical_charset (char *, size_t, const char *); -int mutt_count_body_parts (HEADER *hdr, int flags); void mutt_check_rescore (CONTEXT *); void mutt_clear_error (void); void mutt_default_save (char *, size_t, HEADER *); -- 2.20.1