if (mutt_is_message_type(m->type, m->subtype)) { saved_parts = m->parts; saved_hdr = m->hdr; m->parts = mutt_parse_messageRFC822 (s.fpin, m); }
saved_parts = m->parts; saved_hdr = m->hdr; mutt_parse_part (s.fpin, m);
int mutt_decode_save_attachment (FILE *fp, BODY *m, char *path,					      int displaying, int flags){  STATE s;  unsigned int saved_encoding = 0;  BODY *saved_parts = NULL;  HEADER *saved_hdr = NULL;  memset (&s, 0, sizeof (s));  s.flags = displaying ? M_DISPLAY : 0;  if (flags == M_SAVE_APPEND)    s.fpout = safe_fopen (path, "a");  else    s.fpout = fopen (path, "w");  if (s.fpout == NULL)  {    perror ("fopen");    return (-1);  }  if (fp == NULL)  {    /* When called from the compose menu, the attachment isn't parsed,     * so we need to do it here. */    struct stat st;    if (stat (m->filename, &st) == -1)    {      perror ("stat");      fclose (s.fpout);      return (-1);    }    if ((s.fpin = fopen (m->filename, "r")) == NULL)    {      perror ("fopen");      return (-1);    }    saved_encoding = m->encoding;    m->length = st.st_size;    m->encoding = ENC8BIT;    m->offset = 0;    if (mutt_is_message_type(m->type, m->subtype))    {      saved_parts = m->parts;      saved_hdr = m->hdr;      m->parts = mutt_parse_messageRFC822 (s.fpin, m);    }  }  else    s.fpin = fp;  mutt_body_handler (m, &s);  fclose (s.fpout);  if (fp == NULL)  {    m->length = 0;    m->encoding = saved_encoding;    if (saved_parts)    {      mutt_free_header (&m->hdr);      m->parts = saved_parts;      m->hdr = saved_hdr;    }    fclose (s.fpin);  }  return (0);}