if (!PL_strcasecmp (a_array1[i], a_array2[j]))
if (!nsCRT::strcasecmp (a_array1[i], a_array2[j]))
msg_remove_duplicate_addresses(const char *addrs, const char *other_addrs,                               PRBool removeAliasesToMe){	if (!addrs) return 0;	/* This is probably way more complicated than it should be... */	char *s1 = 0, *s2 = 0;	char *output = 0, *out = 0;	char *result = 0;	int count1 = 0, count2 = 0, count3 = 0;	int size1 = 0, size2 = 0, size3 = 0;	char *names1 = 0, *names2 = 0;	char *addrs1 = 0, *addrs2 = 0;	char **a_array1 = 0, **a_array2 = 0, **a_array3 = 0;	char **n_array1 = 0,                 **n_array3 = 0;	int i, j;	count1 = msg_parse_Header_addresses(addrs, &names1, &addrs1);	if (count1 < 0) goto FAIL;	if (count1 == 0)	{		result = PL_strdup("");		goto FAIL;	}	if (other_addrs)		count2 = msg_parse_Header_addresses(other_addrs, &names2, &addrs2);	if (count2 < 0) goto FAIL;	s1 = names1;	s2 = addrs1;	for (i = 0; i < count1; i++)	{		PRUint32 len1 = PL_strlen(s1);		PRUint32 len2 = PL_strlen(s2);		s1 += len1 + 1;		s2 += len2 + 1;		size1 += len1 + len2 + 10;	}	s1 = names2;	s2 = addrs2;	for (i = 0; i < count2; i++)	{		PRUint32 len1 = PL_strlen(s1);		PRUint32 len2 = PL_strlen(s2);		s1 += len1 + 1;		s2 += len2 + 1;		size2 += len1 + len2 + 10;	}	a_array1 = (char **)PR_Malloc(count1 * sizeof(char *));	if (!a_array1) goto FAIL;	n_array1 = (char **)PR_Malloc(count1 * sizeof(char *));	if (!n_array1) goto FAIL;	if (count2 > 0)	{		a_array2 = (char **)PR_Malloc(count2 * sizeof(char *));		if (!a_array2) goto FAIL;		/* don't need an n_array2 */	}	a_array3 = (char **)PR_Malloc(count1 * sizeof(char *));	if (!a_array3) goto FAIL;	n_array3 = (char **)PR_Malloc(count1 * sizeof(char *));	if (!n_array3) goto FAIL;	/* fill in the input arrays */	s1 = names1;	s2 = addrs1;	for (i = 0; i < count1; i++)	{		n_array1[i] = s1;		a_array1[i] = s2;		s1 += PL_strlen(s1) + 1;		s2 += PL_strlen(s2) + 1;	}	s2 = addrs2;	for (i = 0; i < count2; i++)	{		a_array2[i] = s2;		s2 += PL_strlen(s2) + 1;	}	/* Iterate over all addrs in the "1" arrays.	 * If those addrs are not present in "3" or "2", add them to "3".	 */	for (i = 0; i < count1; i++)	{		PRBool found = PR_FALSE;		for (j = 0; j < count2; j++)			if (!PL_strcasecmp (a_array1[i], a_array2[j]))			{				found = PR_TRUE;				break;			}		if (!found)			for (j = 0; j < count3; j++)				if (!PL_strcasecmp(a_array1[i], a_array3[j]))				{					found = PR_TRUE;					break;				}/* HACK ALERT!!!! TEMPORARILY COMMENTING OUT UNTIL WE PORT MSG_PREFS INTO THE MOZILLA TREE!!!!!! */#if 0		if (!found && removeAliasesToMe)		{			found = MSG_Prefs::IsEmailAddressAnAliasForMe(a_array1[i]);			if (found)				break;		}#endif		if (!found)		{			n_array3[count3] = n_array1[i];			a_array3[count3] = a_array1[i];			size3 += (PL_strlen(n_array3[count3]) + PL_strlen(a_array3[count3])	+ 10);			count3++;			NS_ASSERTION (count3 <= count1, "");			if (count3 > count1) break;		}	}	output = (char *)PR_Malloc(size3 + 1);	if (!output) goto FAIL;	*output = 0;	out = output;	s2 = output;	for (i = 0; i < count3; i++)	{		PL_strcpy(out, a_array3[i]);		out += PL_strlen(out);		*out++ = 0;	}	s1 = out;	for (i = 0; i < count3; i++)	{		PL_strcpy(out, n_array3[i]);		out += PL_strlen(out);		*out++ = 0;	}	result = msg_format_Header_addresses(s1, s2, count3, PR_FALSE); FAIL:	FREEIF(a_array1);	FREEIF(a_array2);	FREEIF(a_array3);	FREEIF(n_array1);	FREEIF(n_array3);	FREEIF(names1);	FREEIF(names2);	FREEIF(addrs1);	FREEIF(addrs2);	FREEIF(output);	return result;}