Fix message filter matching failures on Message-ID and Content-Type: charset (bug 152468); r=naving@netscape.com, sr=bienvenu@netscape.com

This commit is contained in:
dmose%netscape.com 2002-07-08 23:58:42 +00:00
Родитель 2969a87417
Коммит 262731580a
1 изменённых файлов: 23 добавлений и 9 удалений

Просмотреть файл

@ -1247,8 +1247,10 @@ int nsParseMailMessageState::FinalizeHeaders()
ch = PL_strchr(recipient->value, ',');
if (ch)
{
*ch = 0;
recipient->length = strlen(recipient->value);
/* generate a new string that terminates before the , */
nsCAutoString firstGroup;
firstGroup.Assign(recipient->value, ch - recipient->value);
m_newMsgHdr->SetRecipients(firstGroup.get());
}
m_newMsgHdr->SetRecipients(recipient->value);
}
@ -1317,10 +1319,15 @@ int nsParseMailMessageState::FinalizeHeaders()
/* Take off <> around message ID. */
if (id->value[0] == '<')
id->value++, id->length--;
if (id->value[id->length-1] == '>')
((char *) id->value) [id->length-1] = 0, id->length--; /* #### const */
if (id->value[id->length-1] == '>') {
/* generate a new null-terminated string without the final > */
nsCAutoString rawMsgId;
rawMsgId.Assign(id->value, id->length - 1);
m_newMsgHdr->SetMessageId(rawMsgId.get());
} else {
m_newMsgHdr->SetMessageId(id->value);
}
if (!mozstatus && statush)
{
@ -1378,7 +1385,13 @@ int nsParseMailMessageState::FinalizeHeaders()
end++;
if (*charset)
{
*end = '\0';
if (*end != '\0') {
// if we're not at the very end of the line, we need
// to generate a new string without the trailing crud
nsCAutoString rawCharSet;
rawCharSet.Assign(charset, end - charset);
m_newMsgHdr->SetCharset(rawCharSet.get());
} else {
m_newMsgHdr->SetCharset(charset);
}
}
@ -1386,6 +1399,7 @@ int nsParseMailMessageState::FinalizeHeaders()
}
}
}
}
else
{
NS_ASSERTION(PR_FALSE, "error creating message header");