simplify alias expansion a lot.
[apps/madmutt.git] / lib-mime / rfc822parse.c
index ceef3cc..1eee71a 100644 (file)
 #include <lib-lib/macros.h>
 #include <lib-lib/buffer.h>
 #include <lib-lib/date.h>
+#include <lib-lib/debug.h>
+#include <lib-lib/url.h>
 
 #include "recvattach.h"
-#include "url.h"
-
-#include "lib/debug.h"
 
 #include "mime.h"
 
@@ -1062,7 +1061,6 @@ LIST **mutt_parse_rfc822_line(ENVELOPE *e, HEADER *hdr, char *line, char *p,
         (*user_hdrs)->data = m_strdup(line);
         if (do_2047)
             rfc2047_decode(&(*user_hdrs)->data);
-        (*user_hdrs)->next = mutt_new_list();
         return &(*user_hdrs)->next;
     }
 
@@ -1203,8 +1201,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 +1256,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;
 }