*out++ = CR; *out++ = LF;
*out++ = nsCRT::CR; *out++ = nsCRT::LF;
mime_fix_header_1 (const char *string, PRBool addr_p, PRBool news_p){	char *new_string;	const char *in;	char *out;	PRInt32 i, old_size, new_size;	if (!string || !*string)		return 0;	if (addr_p) {    nsresult rv = NS_OK;		nsCOMPtr<nsIMsgHeaderParser> pHeader = do_GetService(kMsgHeaderParserCID, &rv);		if (NS_SUCCEEDED(rv)) {			char *n;			pHeader->ReformatHeaderAddresses(nsnull, string, &n);			if (n)				return n;		}	}	old_size = PL_strlen (string);	new_size = old_size;	for (i = 0; i < old_size; i++)		if (string[i] == CR || string[i] == LF)			new_size += 2;	new_string = (char *) PR_Malloc (new_size + 1);	if (! new_string)		return 0;	in  = string;	out = new_string;	/* strip leading whitespace. */	while (IS_SPACE (*in))		in++;	/* replace CR, LF, or CRLF with CRLF-TAB. */	while (*in) {		if (*in == CR || *in == LF) {			if (*in == CR && in[1] == LF)				in++;			in++;			*out++ = CR;			*out++ = LF;			*out++ = '\t';		}		else			if (news_p && *in == ',') {				*out++ = *in++;				/* skip over all whitespace after a comma. */				while (IS_SPACE (*in))					in++;			}			else				*out++ = *in++;	}	*out = 0;	/* strip trailing whitespace. */	while (out > in && IS_SPACE (out[-1]))		*out-- = 0;	/* If we ended up throwing it all away, use 0 instead of "". */	if (!*new_string) {		PR_Free (new_string);		new_string = 0;	}	return new_string;}