MimeHeaders_get_name(MimeHeaders *hdrs, MimeDisplayOptions *opts)
MimeHeaders_get_name(MimeHeaders *hdrs, MimeDisplayOptions *opt)
MimeHeaders_get_name(MimeHeaders *hdrs, MimeDisplayOptions *opts){  char *s = 0, *name = 0, *cvt = 0;  char *charset = nsnull; // for RFC2231 support  s = MimeHeaders_get(hdrs, HEADER_CONTENT_DISPOSITION, PR_FALSE, PR_FALSE);  if (s)	{	  name = MimeHeaders_get_parameter(s, HEADER_PARM_FILENAME, &charset, NULL);	  PR_Free(s);	}  if (! name)  {	  s = MimeHeaders_get(hdrs, HEADER_CONTENT_TYPE, PR_FALSE, PR_FALSE);	  if (s)	  {		  PR_FREEIF(charset);		  name = MimeHeaders_get_parameter(s, HEADER_PARM_NAME, &charset, NULL);		  PR_Free(s);	  }  }  if (! name)	  name = MimeHeaders_get (hdrs, HEADER_CONTENT_NAME, PR_FALSE, PR_FALSE);    if (! name)	  name = MimeHeaders_get (hdrs, HEADER_X_SUN_DATA_NAME, PR_FALSE, PR_FALSE);  if (name)  {		/*	First remove continuation delimiters (CR+LF+space), then			remove escape ('\\') characters, then attempt to decode			mime-2 encoded-words. The latter two are done in 			mime_decode_filename. 			*/		MIME_StripContinuations(name);		/*	Argh. What we should do if we want to be robust is to decode qtext			in all appropriate headers. Unfortunately, that would be too scary			at this juncture. So just decode qtext/mime2 here. */		cvt = mime_decode_filename(name, charset,                                   opts->default_charset,                                   opts->override_charset);		PR_FREEIF(charset);	   	if (cvt && cvt != name)	   	{	   		PR_Free(name);	   		name = cvt;	   	}  }  return name;}