aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2013-03-24 09:00:30 +0000
committerVincent Richard <[email protected]>2013-03-24 09:00:30 +0000
commit005e7af6cdcccb0f825362214d8cffe34d6e52e5 (patch)
tree34648c9e7c2ce6bb19b9f932ff455224d90e31f3
parentFixed library version. (diff)
downloadvmime-005e7af6cdcccb0f825362214d8cffe34d6e52e5.tar.gz
vmime-005e7af6cdcccb0f825362214d8cffe34d6e52e5.zip
Fixed whitespace parsing before word.
-rw-r--r--src/word.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/word.cpp b/src/word.cpp
index b558b842..8e254865 100644
--- a/src/word.cpp
+++ b/src/word.cpp
@@ -125,7 +125,7 @@ ref <word> word::parseNext
if (!unencoded.empty())
{
- if (prevIsEncoded)
+ if (prevIsEncoded && !isFirst)
unencoded = whiteSpaces + unencoded;
ref <word> w = vmime::create <word>(unencoded, defaultCharset);
@@ -200,11 +200,13 @@ ref <word> word::parseNext
++pos;
}
- if (startPos != end && !isFirst && prevIsEncoded)
- unencoded += whiteSpaces;
-
if (startPos != end)
+ {
+ if (prevIsEncoded && !isFirst)
+ unencoded = whiteSpaces + unencoded;
+
unencoded += buffer.substr(startPos, end - startPos);
+ }
// Treat unencoded text at the end of the buffer
if (!unencoded.empty())