diff options
author | Vincent Richard <[email protected]> | 2004-11-06 10:46:02 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2004-11-06 10:46:02 +0000 |
commit | c34d699f987cb378a47445fabfdc4070151f1731 (patch) | |
tree | af08efb2d57417d6f8f8709d985d77e12cf241e8 | |
parent | Fixed operator==(). (diff) | |
download | vmime-c34d699f987cb378a47445fabfdc4070151f1731.tar.gz vmime-c34d699f987cb378a47445fabfdc4070151f1731.zip |
Fixed bug with white-space in email address.
-rw-r--r-- | src/mailbox.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/mailbox.cpp b/src/mailbox.cpp index bb5d3c5d..1420f738 100644 --- a/src/mailbox.cpp +++ b/src/mailbox.cpp @@ -304,13 +304,27 @@ void mailbox::parse(const string& buffer, const string::size_type position, // (email address is mandatory, whereas name is optional). if (address.empty() && !name.empty()) { - m_email = name; + m_email.empty(); + m_email.reserve(name.size()); m_name.removeAllWords(); + + for (string::size_type i = 0 ; i < name.size() ; ++i) + { + if (!isspace(name[i])) + m_email += name[i]; + } } else { decodeAndUnfoldText(name, m_name); - m_email = address; + m_email.empty(); + m_email.reserve(address.size()); + + for (string::size_type i = 0 ; i < address.size() ; ++i) + { + if (!isspace(address[i])) + m_email += address[i]; + } } if (newPosition) |