if (i == 0 && head[0] == 'F' && !nsCRT::strncmp(head, "From ", 5))
if (i == 0 && head[0] == 'F' && !strncmp(head, "From ", 5))
MimeHeaders_write_all_headers (MimeHeaders *hdrs, MimeDisplayOptions *opt, PRBool attachment){  int status = 0;  int i;  PRBool wrote_any_p = PR_FALSE;  NS_ASSERTION(hdrs, "1.1 <rhp@netscape.com> 19 Mar 1999 12:00");  if (!hdrs)     return -1;  /* One shouldn't be trying to read headers when one hasn't finished     parsing them yet... but this can happen if the message ended     prematurely, and has no body at all (as opposed to a null body,     which is more normal.)   So, if we try to read from the headers,     let's assume that the headers are now finished.  If they aren't     in fact finished, then a later attempt to write to them will assert.   */  if (!hdrs->done_p)  {    hdrs->done_p = PR_TRUE;    status = MimeHeaders_build_heads_list(hdrs);    if (status < 0) return 0;  }  char *charset = nsnull;  if (opt->format_out == nsMimeOutput::nsMimeMessageSaveAs)  {    if (opt->override_charset)      charset = PL_strdup(opt->default_charset);    else    {      char *contentType = MimeHeaders_get(hdrs, HEADER_CONTENT_TYPE, PR_FALSE, PR_FALSE);      if (contentType)        charset = MimeHeaders_get_parameter(contentType, HEADER_PARM_CHARSET, nsnull, nsnull);      PR_FREEIF(contentType);    }  }  for (i = 0; i < hdrs->heads_size; i++)  {    char *head = hdrs->heads[i];    char *end = (i == hdrs->heads_size-1                      ? hdrs->all_headers + hdrs->all_headers_fp                      : hdrs->heads[i+1]);    char *colon, *ocolon;    char *contents = end;    char *name = 0;    char *hdr_value;    hdr_value = 0;        /* Hack for BSD Mailbox delimiter. */    if (i == 0 && head[0] == 'F' && !nsCRT::strncmp(head, "From ", 5))    {      /* For now, we don't really want this header to be output so         we are going to just continue */      continue;      /* colon = head + 4; contents = colon + 1; */    }    else    {      /* Find the colon. */      for (colon = head; colon < end && *colon != ':'; colon++)        ;                /* Back up over whitespace before the colon. */        ocolon = colon;        for (; colon > head && nsCRT::IsAsciiSpace(colon[-1]); colon--)          ;                contents = ocolon + 1;    }        /* Skip over whitespace after colon. */    while (contents < end && nsCRT::IsAsciiSpace(*contents))      contents++;        /* Take off trailing whitespace... */    while (end > contents && nsCRT::IsAsciiSpace(end[-1]))      end--;        name = (char *)PR_MALLOC(colon - head + 1);    if (!name) return MIME_OUT_OF_MEMORY;    memcpy(name, head, colon - head);    name[colon - head] = 0;      if ( (end - contents) > 0 )    {      hdr_value = (char *)PR_MALLOC(end - contents + 1);      if (!hdr_value)      {        PR_Free(name);        return MIME_OUT_OF_MEMORY;      }      memcpy(hdr_value, contents, end - contents);      hdr_value[end - contents] = 0;    }        MimeHeaders_convert_header_value(opt, &hdr_value);    // if we're saving as html, we need to convert headers from utf8 to message charset, if any    if (opt->format_out == nsMimeOutput::nsMimeMessageSaveAs && charset)    {      char *convertedStr;      if (NS_SUCCEEDED(ConvertFromUnicode(charset, NS_ConvertUTF8toUCS2(hdr_value), &convertedStr)))      {        PR_FREEIF(hdr_value);        hdr_value = convertedStr;      }    }    if (attachment)      status = mimeEmitterAddAttachmentField(opt, name, hdr_value);    else      status = mimeEmitterAddHeaderField(opt, name, hdr_value);    PR_Free(name);    PR_FREEIF(hdr_value);        if (status < 0) return status;    if (!wrote_any_p)       wrote_any_p = (status > 0);  }  mimeEmitterAddAllHeaders(opt, hdrs->all_headers, hdrs->all_headers_fp);  PR_FREEIF(charset);  return 1;}