зеркало из https://github.com/mozilla/gecko-dev.git
fixed bug 9540, 10827, 11991 - copy news article failed on certain platforms; replacing CRLF to platform specific MSG_LINEBREAK; reviewed by mscott
This commit is contained in:
Родитель
97af25e48e
Коммит
1146b33fc0
|
@ -1600,7 +1600,7 @@ NS_IMETHODIMP nsMsgLocalMailFolder::BeginCopy(nsIMessage *message)
|
||||||
&now);
|
&now);
|
||||||
result.Append("From - ");
|
result.Append("From - ");
|
||||||
result.Append(timeBuffer);
|
result.Append(timeBuffer);
|
||||||
result.Append(CRLF);
|
result.Append(MSG_LINEBREAK);
|
||||||
|
|
||||||
// *** jt - hard code status line for now; come back later
|
// *** jt - hard code status line for now; come back later
|
||||||
|
|
||||||
|
@ -1608,12 +1608,12 @@ NS_IMETHODIMP nsMsgLocalMailFolder::BeginCopy(nsIMessage *message)
|
||||||
if (mCopyState->m_parseMsgState)
|
if (mCopyState->m_parseMsgState)
|
||||||
mCopyState->m_parseMsgState->ParseAFolderLine(
|
mCopyState->m_parseMsgState->ParseAFolderLine(
|
||||||
result.GetBuffer(), result.Length());
|
result.GetBuffer(), result.Length());
|
||||||
result = "X-Mozilla-Status: 0001" CRLF;
|
result = "X-Mozilla-Status: 0001" MSG_LINEBREAK;
|
||||||
*(mCopyState->m_fileStream) << result.GetBuffer();
|
*(mCopyState->m_fileStream) << result.GetBuffer();
|
||||||
if (mCopyState->m_parseMsgState)
|
if (mCopyState->m_parseMsgState)
|
||||||
mCopyState->m_parseMsgState->ParseAFolderLine(
|
mCopyState->m_parseMsgState->ParseAFolderLine(
|
||||||
result.GetBuffer(), result.Length());
|
result.GetBuffer(), result.Length());
|
||||||
result = "X-Mozilla-Status2: 00000000" CRLF;
|
result = "X-Mozilla-Status2: 00000000" MSG_LINEBREAK;
|
||||||
*(mCopyState->m_fileStream) << result.GetBuffer();
|
*(mCopyState->m_fileStream) << result.GetBuffer();
|
||||||
if (mCopyState->m_parseMsgState)
|
if (mCopyState->m_parseMsgState)
|
||||||
mCopyState->m_parseMsgState->ParseAFolderLine(
|
mCopyState->m_parseMsgState->ParseAFolderLine(
|
||||||
|
@ -1654,16 +1654,17 @@ NS_IMETHODIMP nsMsgLocalMailFolder::CopyData(nsIInputStream *aIStream, PRInt32 a
|
||||||
if (mCopyState->m_parseMsgState)
|
if (mCopyState->m_parseMsgState)
|
||||||
{
|
{
|
||||||
char* start = mCopyState->m_dataBuffer;
|
char* start = mCopyState->m_dataBuffer;
|
||||||
char* end = PL_strstr(mCopyState->m_dataBuffer, CRLF);
|
char* end = PL_strstr(mCopyState->m_dataBuffer, MSG_LINEBREAK);
|
||||||
|
|
||||||
while (start && end)
|
while (start && end)
|
||||||
{
|
{
|
||||||
// +2 counting for the CRLF
|
mCopyState->m_parseMsgState->ParseAFolderLine(start,
|
||||||
mCopyState->m_parseMsgState->ParseAFolderLine(start, end-start+2);
|
end-start +
|
||||||
start = end+2;
|
MSG_LINEBREAK_LEN);
|
||||||
|
start = end+MSG_LINEBREAK_LEN;
|
||||||
if (start >= &mCopyState->m_dataBuffer[readCount])
|
if (start >= &mCopyState->m_dataBuffer[readCount])
|
||||||
break;
|
break;
|
||||||
end = PL_strstr(start, CRLF);
|
end = PL_strstr(start, MSG_LINEBREAK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1722,9 +1723,9 @@ NS_IMETHODIMP nsMsgLocalMailFolder::EndCopy(PRBool copySucceeded)
|
||||||
if (mCopyState->m_dummyEnvelopeNeeded)
|
if (mCopyState->m_dummyEnvelopeNeeded)
|
||||||
{
|
{
|
||||||
mCopyState->m_fileStream->seek(PR_SEEK_END, 0);
|
mCopyState->m_fileStream->seek(PR_SEEK_END, 0);
|
||||||
*(mCopyState->m_fileStream) << CRLF;
|
*(mCopyState->m_fileStream) << MSG_LINEBREAK;
|
||||||
if (mCopyState->m_parseMsgState)
|
if (mCopyState->m_parseMsgState)
|
||||||
mCopyState->m_parseMsgState->ParseAFolderLine(CRLF, 2);
|
mCopyState->m_parseMsgState->ParseAFolderLine(CRLF, MSG_LINEBREAK_LEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
// CopyFileMessage() and CopyMessages() from servers other than mailbox
|
// CopyFileMessage() and CopyMessages() from servers other than mailbox
|
||||||
|
|
Загрузка…
Ссылка в новой задаче