mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-14 18:51:28 +00:00
fix 83396 alert: message contains bare newlines when copying local message to cyrus/netscape imap server, sr=mscott
This commit is contained in:
parent
ce5ba6cc48
commit
887deef184
@ -2904,7 +2904,7 @@ NS_IMETHODIMP nsImapMailFolder::CopyData(nsIInputStream *aIStream,
|
||||
}
|
||||
|
||||
char *start, *end;
|
||||
PRUint32 linebreak_len = 0;
|
||||
PRUint32 linebreak_len = 1;
|
||||
|
||||
rv = aIStream->Read(m_copyState->m_dataBuffer+m_copyState->m_leftOver, aLength, &readCount);
|
||||
if (NS_FAILED(rv))
|
||||
@ -2917,12 +2917,9 @@ NS_IMETHODIMP nsImapMailFolder::CopyData(nsIInputStream *aIStream,
|
||||
end = PL_strchr(start, '\r');
|
||||
if (!end)
|
||||
end = PL_strchr(start, '\n');
|
||||
else if (*(end+1) == nsCRT::LF && linebreak_len == 0)
|
||||
else if (*(end+1) == nsCRT::LF)
|
||||
linebreak_len = 2;
|
||||
|
||||
if (linebreak_len == 0) // not initialize yet
|
||||
linebreak_len = 1;
|
||||
|
||||
while (start && end)
|
||||
{
|
||||
if (PL_strncasecmp(start, "X-Mozilla-Status:", 17) &&
|
||||
@ -2941,9 +2938,14 @@ NS_IMETHODIMP nsImapMailFolder::CopyData(nsIInputStream *aIStream,
|
||||
m_copyState->m_leftOver = 0;
|
||||
break;
|
||||
}
|
||||
linebreak_len = 1;
|
||||
|
||||
end = PL_strchr(start, '\r');
|
||||
if (!end)
|
||||
end = PL_strchr(start, '\n');
|
||||
else if (*(end+1) == nsCRT::LF)
|
||||
linebreak_len = 2;
|
||||
|
||||
if (start && !end)
|
||||
{
|
||||
m_copyState->m_leftOver -= (start - m_copyState->m_dataBuffer);
|
||||
|
Loading…
Reference in New Issue
Block a user