]> granicus.if.org Git - neomutt/commitdiff
Convert userhdrs to STailQ
authorPietro Cerutti <gahr@gahr.ch>
Mon, 24 Jul 2017 12:08:15 +0000 (12:08 +0000)
committerRichard Russon <rich@flatcap.org>
Sat, 5 Aug 2017 17:53:06 +0000 (18:53 +0100)
Issue #374

envelope.h
hcache/hcache.c
headers.c
main.c
muttlib.c
parse.c
postpone.c
protos.h
send.c
sendlib.c
url.c

index d6290793d0bea5185b47ece31e35e9e857d83953..2ea10fdb55161c0d74659a445f88e6234e6dbf27 100644 (file)
@@ -59,7 +59,7 @@ struct Envelope
   struct Buffer *spam;
   struct STailQHead references;  /**< message references (in reverse order) */
   struct STailQHead in_reply_to; /**< in-reply-to header content */
-  struct List *userhdrs;    /**< user defined headers */
+  struct STailQHead userhdrs;    /**< user defined headers */
   int kwtypes;
 
   bool irt_changed : 1;  /**< In-Reply-To changed to link/break threads */
@@ -71,6 +71,7 @@ static inline struct Envelope *mutt_new_envelope(void)
   struct Envelope *e = safe_calloc(1, sizeof(struct Envelope));
   STAILQ_INIT(&e->references);
   STAILQ_INIT(&e->in_reply_to);
+  STAILQ_INIT(&e->userhdrs);
   return e;
 }
 
index 250f2c2c4ac767cccc3b87d8acc63efae8657fd5..b33705b697df66c23ead8404923f64b36c59a6a0 100644 (file)
@@ -286,25 +286,6 @@ static void restore_address(struct Address **a, const unsigned char *d, int *off
   *a = NULL;
 }
 
-static unsigned char *dump_list(struct List *l, unsigned char *d, int *off, int convert)
-{
-  unsigned int counter = 0;
-  unsigned int start_off = *off;
-
-  d = dump_int(0xdeadbeef, d, off);
-
-  while (l)
-  {
-    d = dump_char(l->data, d, off, convert);
-    l = l->next;
-    counter++;
-  }
-
-  memcpy(d + start_off, &counter, sizeof(int));
-
-  return d;
-}
-
 static unsigned char *dump_stailq(struct STailQHead *l, unsigned char *d, int *off, int convert)
 {
   unsigned int counter = 0;
@@ -324,23 +305,6 @@ static unsigned char *dump_stailq(struct STailQHead *l, unsigned char *d, int *o
   return d;
 }
 
-static void restore_list(struct List **l, const unsigned char *d, int *off, int convert)
-{
-  unsigned int counter;
-
-  restore_int(&counter, d, off);
-
-  while (counter)
-  {
-    *l = safe_malloc(sizeof(struct List));
-    restore_char(&(*l)->data, d, off, convert);
-    l = &(*l)->next;
-    counter--;
-  }
-
-  *l = NULL;
-}
-
 static void restore_stailq(struct STailQHead *l, const unsigned char *d, int *off, int convert)
 {
   unsigned int counter;
@@ -510,7 +474,7 @@ static unsigned char *dump_envelope(struct Envelope *e, unsigned char *d, int *o
 
   d = dump_stailq(&e->references, d, off, 0);
   d = dump_stailq(&e->in_reply_to, d, off, 0);
-  d = dump_list(e->userhdrs, d, off, convert);
+  d = dump_stailq(&e->userhdrs, d, off, convert);
 
 #ifdef USE_NNTP
   d = dump_char(e->xref, d, off, 0);
@@ -552,7 +516,7 @@ static void restore_envelope(struct Envelope *e, const unsigned char *d, int *of
 
   restore_stailq(&e->references, d, off, 0);
   restore_stailq(&e->in_reply_to, d, off, 0);
-  restore_list(&e->userhdrs, d, off, convert);
+  restore_stailq(&e->userhdrs, d, off, convert);
 
 #ifdef USE_NNTP
   restore_char(&e->xref, d, off, 0);
index fde5cc2ba333fd5d5171a6c04b078c4d52e698ef..46841b48260e4b27507444d212a9892aa5c1c5d8 100644 (file)
--- a/headers.c
+++ b/headers.c
@@ -54,7 +54,6 @@ void mutt_edit_headers(const char *editor, const char *body, struct Header *msg,
   struct Envelope *n = NULL;
   time_t mtime;
   struct stat st;
-  struct List *cur = NULL, **last = NULL, *tmp = NULL;
 
   mutt_mktemp(path, sizeof(path));
   if ((ofp = safe_fopen(path, "w")) == NULL)
@@ -99,7 +98,7 @@ void mutt_edit_headers(const char *editor, const char *body, struct Header *msg,
   }
 
   mutt_unlink(body);
-  mutt_free_list(&msg->env->userhdrs);
+  mutt_free_stailq(&msg->env->userhdrs);
 
   /* Read the temp file back in */
   if ((ifp = fopen(path, "r")) == NULL)
@@ -150,15 +149,14 @@ void mutt_edit_headers(const char *editor, const char *body, struct Header *msg,
    * fcc: or attach: or pgp: was specified
    */
 
-  cur = msg->env->userhdrs;
-  last = &msg->env->userhdrs;
-  while (cur)
+  struct STailQNode *np, *tmp;
+  STAILQ_FOREACH_SAFE(np, &msg->env->userhdrs, entries, tmp)
   {
     keep = true;
 
-    if (fcc && (mutt_strncasecmp("fcc:", cur->data, 4) == 0))
+    if (fcc && (mutt_strncasecmp("fcc:", np->data, 4) == 0))
     {
-      p = skip_email_wsp(cur->data + 4);
+      p = skip_email_wsp(np->data + 4);
       if (*p)
       {
         strfcpy(fcc, p, fcclen);
@@ -166,13 +164,13 @@ void mutt_edit_headers(const char *editor, const char *body, struct Header *msg,
       }
       keep = false;
     }
-    else if (mutt_strncasecmp("attach:", cur->data, 7) == 0)
+    else if (mutt_strncasecmp("attach:", np->data, 7) == 0)
     {
       struct Body *body2 = NULL;
       struct Body *parts = NULL;
       size_t l = 0;
 
-      p = skip_email_wsp(cur->data + 7);
+      p = skip_email_wsp(np->data + 7);
       if (*p)
       {
         for (; *p && *p != ' ' && *p != '\t'; p++)
@@ -206,26 +204,19 @@ void mutt_edit_headers(const char *editor, const char *body, struct Header *msg,
       keep = false;
     }
     else if ((WithCrypto & APPLICATION_PGP) &&
-             (mutt_strncasecmp("pgp:", cur->data, 4) == 0))
+             (mutt_strncasecmp("pgp:", np->data, 4) == 0))
     {
-      msg->security = mutt_parse_crypt_hdr(cur->data + 4, 0, APPLICATION_PGP);
+      msg->security = mutt_parse_crypt_hdr(np->data + 4, 0, APPLICATION_PGP);
       if (msg->security)
         msg->security |= APPLICATION_PGP;
       keep = false;
     }
 
-    if (keep)
+    if (!keep)
     {
-      last = &cur->next;
-      cur = cur->next;
-    }
-    else
-    {
-      tmp = cur;
-      *last = cur->next;
-      cur = cur->next;
-      tmp->next = NULL;
-      mutt_free_list(&tmp);
+      STAILQ_REMOVE(&msg->env->userhdrs, np, STailQNode, entries);
+      FREE(&np->data);
+      FREE(&np);
     }
   }
 }
diff --git a/main.c b/main.c
index 936dafb3e5313cffdb963b18f5af49253f88f2f9..27f1deb6dfa9f50c92bbf5f211cc3656d3642f77 100644 (file)
--- a/main.c
+++ b/main.c
@@ -688,7 +688,6 @@ int main(int argc, char **argv, char **env)
         struct Header *context_hdr = NULL;
         struct Envelope *opts_env = msg->env;
         struct stat st;
-        struct List *uh = NULL, **last_uhp = NULL;
 
         sendflags |= SENDDRAFTFILE;
 
@@ -708,19 +707,18 @@ int main(int argc, char **argv, char **env)
         mutt_prepare_template(fin, NULL, msg, context_hdr, 0);
 
         /* Scan for mutt header to set OPT_RESUME_DRAFT_FILES */
-        for (last_uhp = &msg->env->userhdrs, uh = *last_uhp; uh; uh = *last_uhp)
+        struct STailQNode *np, *tmp;
+        STAILQ_FOREACH_SAFE(np, &msg->env->userhdrs, entries, tmp)
         {
-          if (mutt_strncasecmp("X-Mutt-Resume-Draft:", uh->data, 20) == 0)
+          if (mutt_strncasecmp("X-Mutt-Resume-Draft:", np->data, 20) == 0)
           {
             if (option(OPT_RESUME_EDITED_DRAFT_FILES))
               set_option(OPT_RESUME_DRAFT_FILES);
 
-            *last_uhp = uh->next;
-            uh->next = NULL;
-            mutt_free_list(&uh);
+            STAILQ_REMOVE(&msg->env->userhdrs, np, STailQNode, entries);
+            FREE(&np->data);
+            FREE(&np);
           }
-          else
-            last_uhp = &uh->next;
         }
 
         rfc822_append(&msg->env->to, opts_env->to, 0);
index d387491ced87b9eddbc651804cb206f73b7e5d05..b5e081b3b113689ab3ac6e28b3b7b8aac08f337b 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -745,7 +745,7 @@ void mutt_free_envelope(struct Envelope **p)
 
   mutt_free_stailq(&(*p)->references);
   mutt_free_stailq(&(*p)->in_reply_to);
-  mutt_free_list(&(*p)->userhdrs);
+  mutt_free_stailq(&(*p)->userhdrs);
   FREE(p);
 }
 
@@ -808,9 +808,9 @@ void mutt_merge_envelopes(struct Envelope *base, struct Envelope **extra)
   /* spam and user headers should never be hashed, and the new envelope may
     * have better values. Use new versions regardless. */
   mutt_buffer_free(&base->spam);
-  mutt_free_list(&base->userhdrs);
+  mutt_free_stailq(&base->userhdrs);
   MOVE_ELEM(spam);
-  MOVE_ELEM(userhdrs);
+  MOVE_STAILQ(userhdrs);
 #undef MOVE_ELEM
 
   mutt_free_envelope(extra);
diff --git a/parse.c b/parse.c
index 2fb95afbb79d7f96a94dba87de56ea6b2cacef6c..281b133645d9be32f7a52e910f98ebec12d70181 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -987,14 +987,9 @@ void mutt_parse_mime_message(struct Context *ctx, struct Header *cur)
 }
 
 int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line,
-                           char *p, short user_hdrs, short weed, short do_2047,
-                           struct List **lastp)
+                           char *p, short user_hdrs, short weed, short do_2047)
 {
   int matched = 0;
-  struct List *last = NULL;
-
-  if (lastp)
-    last = *lastp;
 
   switch (tolower(line[0]))
   {
@@ -1345,25 +1340,16 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line,
     /* restore the original line */
     line[strlen(line)] = ':';
 
-    if (weed && option(OPT_WEED) && mutt_matches_ignore(line))
-      goto done;
-
-    if (last)
+    if (!(weed && option(OPT_WEED) && mutt_matches_ignore(line)))
     {
-      last->next = mutt_new_list();
-      last = last->next;
+      struct STailQNode *np = calloc(1, sizeof(struct STailQNode));
+      np->data = safe_strdup(line);
+      STAILQ_INSERT_TAIL(&e->userhdrs, np, entries);
+      if (do_2047)
+        rfc2047_decode(&np->data);
     }
-    else
-      last = e->userhdrs = mutt_new_list();
-    last->data = safe_strdup(line);
-    if (do_2047)
-      rfc2047_decode(&last->data);
   }
 
-done:
-
-  if (lastp)
-    *lastp = last;
   return matched;
 }
 
@@ -1384,7 +1370,6 @@ struct Envelope *mutt_read_rfc822_header(FILE *f, struct Header *hdr,
                                          short user_hdrs, short weed)
 {
   struct Envelope *e = mutt_new_envelope();
-  struct List *last = NULL;
   char *line = safe_malloc(LONG_STRING);
   char *p = NULL;
   LOFF_T loc;
@@ -1480,7 +1465,7 @@ struct Envelope *mutt_read_rfc822_header(FILE *f, struct Header *hdr,
     if (!*p)
       continue; /* skip empty header fields */
 
-    mutt_parse_rfc822_line(e, hdr, line, p, user_hdrs, weed, 1, &last);
+    mutt_parse_rfc822_line(e, hdr, line, p, user_hdrs, weed, 1);
   }
 
   FREE(&line);
index 0f0a3f8356c9fa67cbea8bdf8fd03eaf596adc70..e806a7edb5fea5f47c876ad52d5489569580b010 100644 (file)
@@ -263,9 +263,6 @@ int mutt_get_postponed(struct Context *ctx, struct Header *hdr,
 {
   struct Header *h = NULL;
   int code = SENDPOSTPONED;
-  struct List *tmp = NULL;
-  struct List *last = NULL;
-  struct List *next = NULL;
   const char *p = NULL;
   int opt_delete;
 
@@ -322,47 +319,29 @@ int mutt_get_postponed(struct Context *ctx, struct Header *hdr,
 
   FREE(&PostContext);
 
-  for (tmp = hdr->env->userhdrs; tmp;)
+  struct STailQNode *np, *tmp;
+  STAILQ_FOREACH_SAFE(np, &hdr->env->userhdrs, entries, tmp)
   {
-    if (mutt_strncasecmp("X-Mutt-References:", tmp->data, 18) == 0)
+    if (mutt_strncasecmp("X-Mutt-References:", np->data, 18) == 0)
     {
       if (ctx)
       {
         /* if a mailbox is currently open, look to see if the original message
            the user attempted to reply to is in this mailbox */
-        p = skip_email_wsp(tmp->data + 18);
+        p = skip_email_wsp(np->data + 18);
         if (!ctx->id_hash)
           ctx->id_hash = mutt_make_id_hash(ctx);
         *cur = hash_find(ctx->id_hash, p);
       }
-
-      /* Remove the X-Mutt-References: header field. */
-      next = tmp->next;
-      if (last)
-        last->next = tmp->next;
-      else
-        hdr->env->userhdrs = tmp->next;
-      tmp->next = NULL;
-      mutt_free_list(&tmp);
-      tmp = next;
       if (*cur)
         code |= SENDREPLY;
     }
-    else if (mutt_strncasecmp("X-Mutt-Fcc:", tmp->data, 11) == 0)
+    else if (mutt_strncasecmp("X-Mutt-Fcc:", np->data, 11) == 0)
     {
-      p = skip_email_wsp(tmp->data + 11);
+      p = skip_email_wsp(np->data + 11);
       strfcpy(fcc, p, fcclen);
       mutt_pretty_mailbox(fcc, fcclen);
 
-      /* remove the X-Mutt-Fcc: header field */
-      next = tmp->next;
-      if (last)
-        last->next = tmp->next;
-      else
-        hdr->env->userhdrs = tmp->next;
-      tmp->next = NULL;
-      mutt_free_list(&tmp);
-      tmp = next;
       /* note that x-mutt-fcc was present.  we do this because we want to add a
       * default fcc if the header was missing, but preserve the request of the
       * user to not make a copy if the header field is present, but empty.
@@ -371,70 +350,46 @@ int mutt_get_postponed(struct Context *ctx, struct Header *hdr,
       code |= SENDPOSTPONEDFCC;
     }
     else if ((WithCrypto & APPLICATION_PGP) &&
-             ((mutt_strncmp("Pgp:", tmp->data, 4) == 0) /* this is generated
-                                                       * by old mutt versions
-                                                       */
-              || (mutt_strncmp("X-Mutt-PGP:", tmp->data, 11) == 0)))
+             ((mutt_strncmp("Pgp:", np->data, 4) == 0) /* this is generated
+                                                        * by old mutt versions
+                                                        */
+              || (mutt_strncmp("X-Mutt-PGP:", np->data, 11) == 0)))
     {
-      hdr->security = mutt_parse_crypt_hdr(strchr(tmp->data, ':') + 1, 1, APPLICATION_PGP);
+      hdr->security = mutt_parse_crypt_hdr(strchr(np->data, ':') + 1, 1, APPLICATION_PGP);
       hdr->security |= APPLICATION_PGP;
-
-      /* remove the pgp field */
-      next = tmp->next;
-      if (last)
-        last->next = tmp->next;
-      else
-        hdr->env->userhdrs = tmp->next;
-      tmp->next = NULL;
-      mutt_free_list(&tmp);
-      tmp = next;
     }
     else if ((WithCrypto & APPLICATION_SMIME) &&
-             (mutt_strncmp("X-Mutt-SMIME:", tmp->data, 13) == 0))
+             (mutt_strncmp("X-Mutt-SMIME:", np->data, 13) == 0))
     {
-      hdr->security = mutt_parse_crypt_hdr(strchr(tmp->data, ':') + 1, 1, APPLICATION_SMIME);
+      hdr->security = mutt_parse_crypt_hdr(strchr(np->data, ':') + 1, 1, APPLICATION_SMIME);
       hdr->security |= APPLICATION_SMIME;
-
-      /* remove the smime field */
-      next = tmp->next;
-      if (last)
-        last->next = tmp->next;
-      else
-        hdr->env->userhdrs = tmp->next;
-      tmp->next = NULL;
-      mutt_free_list(&tmp);
-      tmp = next;
     }
 
 #ifdef MIXMASTER
-    else if (mutt_strncmp("X-Mutt-Mix:", tmp->data, 11) == 0)
+    else if (mutt_strncmp("X-Mutt-Mix:", np->data, 11) == 0)
     {
       char *t = NULL;
       mutt_free_list(&hdr->chain);
 
-      t = strtok(tmp->data + 11, " \t\n");
+      t = strtok(np->data + 11, " \t\n");
       while (t)
       {
         hdr->chain = mutt_add_list(hdr->chain, t);
         t = strtok(NULL, " \t\n");
       }
-
-      next = tmp->next;
-      if (last)
-        last->next = tmp->next;
-      else
-        hdr->env->userhdrs = tmp->next;
-      tmp->next = NULL;
-      mutt_free_list(&tmp);
-      tmp = next;
     }
 #endif
 
     else
     {
-      last = tmp;
-      tmp = tmp->next;
+      // skip header removal
+      continue;
     }
+
+    // remove the header
+    STAILQ_REMOVE(&hdr->env->userhdrs, np, STailQNode, entries);
+    FREE(&np->data);
+    FREE(&np);
   }
 
   if (option(OPT_CRYPT_OPPORTUNISTIC_ENCRYPT))
index 2ef06ec44507c85420ab0b67026d78653e67608d..9b0290fcc5021a3464029dcd609365c35cd8fd70 100644 (file)
--- a/protos.h
+++ b/protos.h
@@ -336,7 +336,7 @@ int mutt_parse_unmono(struct Buffer *buf, struct Buffer *s, unsigned long data,
 int mutt_parse_push(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
 int mutt_parse_rc_line(/* const */ char *line, struct Buffer *token, struct Buffer *err);
 int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line, char *p,
-                           short user_hdrs, short weed, short do_2047, struct List **lastp);
+                           short user_hdrs, short weed, short do_2047);
 int mutt_parse_score(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
 int mutt_parse_unscore(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
 int mutt_parse_unhook(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
diff --git a/send.c b/send.c
index 8ad30c0b2c54179583ad2b069ec4c48565732f25..cd7ed4ba6a7e6282e6e3b22fa2a9117c6b08ea15 100644 (file)
--- a/send.c
+++ b/send.c
@@ -364,11 +364,6 @@ static void process_user_recips(struct Envelope *env)
 static void process_user_header(struct Envelope *env)
 {
   struct List *uh = UserHeader;
-  struct List *last = env->userhdrs;
-
-  if (last)
-    while (last->next)
-      last = last->next;
 
   for (; uh; uh = uh->next)
   {
@@ -406,14 +401,9 @@ static void process_user_header(struct Envelope *env)
              (mutt_strncasecmp("subject:", uh->data, 8) != 0) &&
              (mutt_strncasecmp("return-path:", uh->data, 12) != 0))
     {
-      if (last)
-      {
-        last->next = mutt_new_list();
-        last = last->next;
-      }
-      else
-        last = env->userhdrs = mutt_new_list();
-      last->data = safe_strdup(uh->data);
+      struct STailQNode *np = safe_calloc(1, sizeof(struct STailQNode));
+      np->data = safe_strdup(uh->data);
+      STAILQ_INSERT_TAIL(&env->userhdrs, np, entries);
     }
   }
 }
index 9ea786805da1524270d80860be69723a29893a4a..26bcca61b1b89a335e3251a3d466b4d1507dd953 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -2000,7 +2000,6 @@ int mutt_write_rfc822_header(FILE *fp, struct Envelope *env,
 {
   char buffer[LONG_STRING];
   char *p = NULL, *q = NULL;
-  struct List *tmp = env->userhdrs;
   bool has_agent = false; /* user defined user-agent header field exists */
 
   if (mode == 0 && !privacy)
@@ -2124,7 +2123,8 @@ int mutt_write_rfc822_header(FILE *fp, struct Envelope *env,
   }
 
   /* Add any user defined headers */
-  for (; tmp; tmp = tmp->next)
+  struct STailQNode *tmp;
+  STAILQ_FOREACH(tmp, &env->userhdrs, entries)
   {
     if ((p = strchr(tmp->data, ':')))
     {
@@ -2164,18 +2164,19 @@ int mutt_write_rfc822_header(FILE *fp, struct Envelope *env,
   return (ferror(fp) == 0 ? 0 : -1);
 }
 
-static void encode_headers(struct List *h)
+static void encode_headers(struct STailQHead *h)
 {
   char *tmp = NULL;
   char *p = NULL;
   int i;
 
-  for (; h; h = h->next)
+  struct STailQNode *np;
+  STAILQ_FOREACH(np, h, entries)
   {
-    if (!(p = strchr(h->data, ':')))
+    if (!(p = strchr(np->data, ':')))
       continue;
 
-    i = p - h->data;
+    i = p - np->data;
     p = skip_email_wsp(p + 1);
     tmp = safe_strdup(p);
 
@@ -2183,9 +2184,9 @@ static void encode_headers(struct List *h)
       continue;
 
     rfc2047_encode_string(&tmp);
-    safe_realloc(&h->data, mutt_strlen(h->data) + 2 + mutt_strlen(tmp) + 1);
+    safe_realloc(&np->data, mutt_strlen(np->data) + 2 + mutt_strlen(tmp) + 1);
 
-    sprintf(h->data + i, ": %s", NONULL(tmp));
+    sprintf(np->data + i, ": %s", NONULL(tmp));
 
     FREE(&tmp);
   }
@@ -2657,15 +2658,16 @@ void mutt_prepare_envelope(struct Envelope *env, int final)
     {
       rfc2047_encode_string(&env->subject);
     }
-  encode_headers(env->userhdrs);
+  encode_headers(&env->userhdrs);
 }
 
 void mutt_unprepare_envelope(struct Envelope *env)
 {
-  struct List *item = NULL;
-
-  for (item = env->userhdrs; item; item = item->next)
+  struct STailQNode *item;
+  STAILQ_FOREACH(item, &env->userhdrs, entries)
+  {
     rfc2047_decode(&item->data);
+  }
 
   rfc822_free_address(&env->mail_followup_to);
 
diff --git a/url.c b/url.c
index 8577ec51c17fa04ac153efc7361f9e26590c095d..02c208be36a954c1ffe34657ab22e837a5a02b1d 100644 (file)
--- a/url.c
+++ b/url.c
@@ -273,8 +273,6 @@ int url_parse_mailto(struct Envelope *e, char **body, const char *src)
 
   int rc = -1;
 
-  struct List *last = NULL;
-
   if (!(t = strchr(src, ':')))
     return -1;
 
@@ -330,7 +328,7 @@ int url_parse_mailto(struct Envelope *e, char **body, const char *src)
         safe_asprintf(&scratch, "%s: %s", tag, value);
         scratch[taglen] = 0; /* overwrite the colon as mutt_parse_rfc822_line expects */
         value = skip_email_wsp(&scratch[taglen + 1]);
-        mutt_parse_rfc822_line(e, NULL, scratch, value, 1, 0, 1, &last);
+        mutt_parse_rfc822_line(e, NULL, scratch, value, 1, 0, 1);
         FREE(&scratch);
       }
     }