if (length > 0 && line[length-1] == LF) length--; if (length > 0 && line[length-1] == CR) length--;
if (length > 0 && line[length-1] == nsCRT::LF) length--; if (length > 0 && line[length-1] == nsCRT::CR) length--;
MimeMultipart_parse_child_line (MimeObject *obj, char *line, PRInt32 length,								PRBool first_line_p){  MimeContainer *cont = (MimeContainer *) obj;  int status;  MimeObject *kid;  PR_ASSERT(cont->nchildren > 0);  if (cont->nchildren <= 0)	return -1;  kid = cont->children[cont->nchildren-1];  PR_ASSERT(kid);  if (!kid) return -1;#ifdef MIME_DRAFTS  if ( obj->options &&	   obj->options->decompose_file_p &&	   obj->options->is_multipart_msg && 	   obj->options->decompose_file_output_fn )   {	if (!mime_typep(obj,(MimeObjectClass*)&mimeMultipartAlternativeClass) &&		!mime_typep(obj,(MimeObjectClass*)&mimeMultipartRelatedClass) &&		!mime_typep(obj,(MimeObjectClass*)&mimeMultipartSignedClass) &&#ifdef MIME_DETAIL_CHECK		!mime_typep(kid,(MimeObjectClass*)&mimeMultipartAlternativeClass) &&		!mime_typep(kid,(MimeObjectClass*)&mimeMultipartRelatedClass) &&		!mime_typep(kid,(MimeObjectClass*)&mimeMultipartSignedClass)#else        /* bug 21869 -- due to the fact that we are not generating the           correct mime class object for content-typ multipart/signed part           the above check failed. to solve the problem in general and not           to cause early temination when parsing message for opening as           draft we can simply make sure that the child is not a multipart           mime object. this way we could have a proper decomposing message           part functions set correctly */        !mime_typep(kid, (MimeObjectClass*) &mimeMultipartClass)#endif#ifdef RICHIE_VCARD    && !mime_typep(kid, (MimeObjectClass*)&mimeInlineTextVCardClass)#endif    )		return obj->options->decompose_file_output_fn (line, length, obj->options->stream_closure);  }#endif /* MIME_DRAFTS */  /* The newline issues here are tricky, since both the newlines before	 and after the boundary string are to be considered part of the	 boundary: this is so that a part can be specified such that it	 does not end in a trailing newline.	 To implement this, we send a newline *before* each line instead	 of after, except for the first line, which is not preceeded by a	 newline.   */  /* Remove the trailing newline... */  if (length > 0 && line[length-1] == LF) length--;  if (length > 0 && line[length-1] == CR) length--;  if (!first_line_p)	{	  /* Push out a preceeding newline... */	  char nl[] = MSG_LINEBREAK;	  status = kid->clazz->parse_buffer (nl, MSG_LINEBREAK_LEN, kid);	  if (status < 0) return status;	}  /* Now push out the line sans trailing newline. */  return kid->clazz->parse_buffer (line, length, kid);}