From c34d699f987cb378a47445fabfdc4070151f1731 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Sat, 6 Nov 2004 10:46:02 +0000 Subject: [PATCH] Fixed bug with white-space in email address. --- src/mailbox.cpp | 18 ++++++++++++++++-- 1 file 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)