summaryrefslogtreecommitdiffstats
path: root/src/libraries/qmfclient
diff options
context:
space:
mode:
authorDamien Caliste <dcaliste@free.fr>2018-09-10 09:23:39 +0200
committerPekka Vuorela <pvuorela@iki.fi>2018-09-29 11:50:34 +0000
commit59c603e58e9aa4c169b0dcc6a58fe806b5fddbab (patch)
treef4992b55d5f2f5b7a5cd51ded883172bfb344857 /src/libraries/qmfclient
parent1c0f376dd35aaf97140dfb7b551a52e176729941 (diff)
Escape last space on a line
According to Rule#3 of http://www.ietf.org/rfc/rfc2045.txt page 19 last space on a line should be escaped to ensure that any trailing spaces are preserved. Change-Id: I68c885e5fef0dc98585caa9b235c51da94aa944f Reviewed-by: Christopher Adams <chris.adams@jollamobile.com> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
Diffstat (limited to 'src/libraries/qmfclient')
-rw-r--r--src/libraries/qmfclient/qmailcodec.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libraries/qmfclient/qmailcodec.cpp b/src/libraries/qmfclient/qmailcodec.cpp
index 5d06c441..f34492a3 100644
--- a/src/libraries/qmfclient/qmailcodec.cpp
+++ b/src/libraries/qmfclient/qmailcodec.cpp
@@ -868,6 +868,10 @@ void QMailQuotedPrintableCodec::encodeChunk(QDataStream& out, const unsigned cha
}
bool escape = requiresEscape(input, _conformance, _encodeLineCharsRemaining);
+ // Escape last space on a line,
+ // see Rule#3 of http://www.ietf.org/rfc/rfc2045.txt page 19.
+ if (input == Space && it != end && (*it == CarriageReturn || *it == LineFeed))
+ escape = true;
int charsRequired = (escape ? 3 : 1);
// If we can't fit this character on the line, insert a line break