delEnd = delParts + strlen(delParts) - 1;
delEnd = delParts + strlen(delParts);
MimeObject_parse_begin (MimeObject *obj){  NS_ASSERTION (!obj->closed_p, "object shouldn't be already closed");  /* If we haven't set up the state object yet, then this should be	 the outermost object... */  if (obj->options && !obj->options->state)  {    NS_ASSERTION(!obj->headers, "headers should be null");  /* should be the outermost object. */    obj->options->state = new MimeParseStateObject;    if (!obj->options->state) return MIME_OUT_OF_MEMORY;    obj->options->state->root = obj;    obj->options->state->separator_suppressed_p = PR_TRUE; /* no first sep */    const char *delParts = PL_strcasestr(obj->options->url, "&del=");    const char *detachLocations = PL_strcasestr(obj->options->url, "&detachTo=");    if (delParts)    {      const char *delEnd = PL_strcasestr(delParts + 1, "&");      if (!delEnd)        delEnd = delParts + strlen(delParts) - 1;      nsCAutoString partsToDel(Substring(delParts + 5, delEnd));       obj->options->state->partsToStrip.ParseString(partsToDel.get(), ",");    }    if (detachLocations)    {      detachLocations += 10; // advance past "&detachTo="      obj->options->state->detachToFiles.ParseString(detachLocations, ",");    }  }  /* Decide whether this object should be output or not... */  if (!obj->options || !obj->options->output_fn    /* if we are decomposing the message in files and processing a multipart object,       we must not output it without parsing it first */     || (obj->options->decompose_file_p && obj->options->decompose_file_output_fn &&	    mime_typep(obj, (MimeObjectClass*) &mimeMultipartClass))     )	  obj->output_p = PR_FALSE;  else if (!obj->options->part_to_load)	  obj->output_p = PR_TRUE;  else	{	  char *id = mime_part_address(obj);	  if (!id) return MIME_OUT_OF_MEMORY;      // We need to check if a part is the subpart of the part to load.      // If so and this is a raw or body display output operation, then      // we should mark the part for subsequent output.      //           // First, check for an exact match      obj->output_p = !strcmp(id, obj->options->part_to_load);       if (!obj->output_p && (obj->options->format_out == nsMimeOutput::nsMimeMessageRaw ||             obj->options->format_out == nsMimeOutput::nsMimeMessageBodyDisplay             || obj->options->format_out == nsMimeOutput::nsMimeMessageAttach))    {        // Then, check for subpart        unsigned int partlen = strlen(obj->options->part_to_load);        obj->output_p = (strlen(id) >= partlen + 2) && (id[partlen] == '.') &&            !strncmp(id, obj->options->part_to_load, partlen);      }	  PR_Free(id);	}/* Way to destroy any notions of modularity or class hierarchy, Terry! */  if (obj->options && obj->options->nice_html_only_p) {	  if (!mime_subclass_p(obj->clazz,						   (MimeObjectClass*) &mimeInlineTextHTMLClass) &&		  !mime_subclass_p(obj->clazz,						   (MimeObjectClass*) &mimeInlineTextPlainClass) &&		  !mime_subclass_p(obj->clazz,						   (MimeObjectClass*) &mimeContainerClass)) {		  obj->output_p = PR_FALSE;	  }  }  return 0;}