diff options
author | Vincent Richard <[email protected]> | 2013-03-11 09:05:09 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2013-03-11 09:05:09 +0000 |
commit | 32a80f6c1ed501ceb2e1d7613dcdcce6cdf6fe23 (patch) | |
tree | 72f7ac0894025d16b8dca950fdfe2df97972faf6 /src/mailboxGroup.cpp | |
parent | Refactored unit tests. (diff) | |
download | vmime-32a80f6c1ed501ceb2e1d7613dcdcce6cdf6fe23.tar.gz vmime-32a80f6c1ed501ceb2e1d7613dcdcce6cdf6fe23.zip |
Fixed mailbox and mailbox group parsing. Added unit tests.
Diffstat (limited to 'src/mailboxGroup.cpp')
-rw-r--r-- | src/mailboxGroup.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mailboxGroup.cpp b/src/mailboxGroup.cpp index 65611b33..9da16653 100644 --- a/src/mailboxGroup.cpp +++ b/src/mailboxGroup.cpp @@ -78,10 +78,11 @@ void mailboxGroup::parseImpl string::size_type pos = position + (p - pstart); + bool isLastAddressOfGroup = false; - while (pos < end) + while (pos < end && !isLastAddressOfGroup) { - ref <address> parsedAddress = address::parseNext(ctx, buffer, pos, end, &pos); + ref <address> parsedAddress = address::parseNext(ctx, buffer, pos, end, &pos, &isLastAddressOfGroup); if (parsedAddress) { @@ -103,7 +104,7 @@ void mailboxGroup::parseImpl } } - text::decodeAndUnfold(ctx, name, &m_name); + text::decodeAndUnfold(ctx, utility::stringUtils::trim(name), &m_name); setParsedBounds(position, end); |