fix 348762, uploading message with mixed line endings can produce corrupted messages, sr=mscott
git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@207627 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -3169,10 +3169,8 @@ NS_IMETHODIMP nsImapMailFolder::CopyDataToOutputStreamForAppend(nsIInputStream *
|
||||
start++;
|
||||
m_copyState->m_eatLF = PR_FALSE;
|
||||
}
|
||||
end = PL_strchr(start, '\r');
|
||||
if (!end)
|
||||
end = PL_strchr(start, '\n');
|
||||
else if (*(end+1) == nsCRT::LF)
|
||||
end = PL_strpbrk(start, "\r\n");
|
||||
if (end && *end == '\r' && *(end+1) == '\n')
|
||||
linebreak_len = 2;
|
||||
|
||||
while (start && end)
|
||||
@@ -3195,13 +3193,14 @@ NS_IMETHODIMP nsImapMailFolder::CopyDataToOutputStreamForAppend(nsIInputStream *
|
||||
}
|
||||
linebreak_len = 1;
|
||||
|
||||
end = PL_strchr(start, '\r');
|
||||
if (!end)
|
||||
end = PL_strchr(start, '\n');
|
||||
else if (*(end+1) == nsCRT::LF)
|
||||
linebreak_len = 2;
|
||||
else if (! *(end+1)) // block might have split CRLF so remember if
|
||||
m_copyState->m_eatLF = PR_TRUE; // we should eat LF
|
||||
end = PL_strpbrk(start, "\r\n");
|
||||
if (end && *end == '\r')
|
||||
{
|
||||
if (*(end+1) == '\n')
|
||||
linebreak_len = 2;
|
||||
else if (! *(end+1)) // block might have split CRLF so remember if
|
||||
m_copyState->m_eatLF = PR_TRUE; // we should eat LF
|
||||
}
|
||||
|
||||
if (start && !end)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user