Fixed bug #2933667: CRLF filter broken.

This commit is contained in:
Vincent Richard 2010-01-20 08:42:47 +00:00
parent 45faafdced
commit b94fe09cae
2 changed files with 3 additions and 2 deletions

View File

@ -231,8 +231,8 @@ void CRLFToLFFilteredOutputStream::write
if (previousChar == '\r')
{
if (pos != data)
m_stream.write(start, pos - 1 - data); // do not write \r
if (pos != start)
m_stream.write(start, pos - 1 - start); // do not write \r
m_stream.write("\n", 1);

View File

@ -175,6 +175,7 @@ VMIME_TEST_SUITE_BEGIN
testFilteredOutputStreamHelper<FILTER>("4", "foo\nbar", "foo", "\r\nbar");
testFilteredOutputStreamHelper<FILTER>("5", "foo\nbar", "foo", "\r", "\nbar");
testFilteredOutputStreamHelper<FILTER>("6", "foo\nbar", "foo", "\r", "\n", "bar");
testFilteredOutputStreamHelper<FILTER>("7", "foo\nba\nr", "foo\r", "\nba\r\nr");
}
// stopSequenceFilteredInputStream