aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2006-08-09 07:18:45 +0000
committerVincent Richard <[email protected]>2006-08-09 07:18:45 +0000
commit3abf3bdcb8200104830c69de6615e09e49bccde7 (patch)
tree61aca4ae65e845763ac0dabcff8b4e36a1b9dace /src
parentAdded exception handling code for 'invalid_response'. (diff)
downloadvmime-3abf3bdcb8200104830c69de6615e09e49bccde7.tar.gz
vmime-3abf3bdcb8200104830c69de6615e09e49bccde7.zip
Fix for message ids without angle brackets.
Diffstat (limited to 'src')
-rw-r--r--src/messageId.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/messageId.cpp b/src/messageId.cpp
index 407c859a..f749148c 100644
--- a/src/messageId.cpp
+++ b/src/messageId.cpp
@@ -101,6 +101,18 @@ void messageId::parse(const string& buffer, const string::size_type position,
}
}
+ // Fix for message ids without angle brackets (invalid)
+ bool hasBrackets = true;
+
+ if (p == pend) // no opening angle bracket found
+ {
+ hasBrackets = false;
+ p = pstart;
+
+ while (p < pend && parserHelpers::isSpace(*p))
+ ++p;
+ }
+
if (p < pend)
{
// Extract left part
@@ -119,7 +131,7 @@ void messageId::parse(const string& buffer, const string::size_type position,
// Extract right part
const string::size_type rightStart = position + (p - pstart);
- while (p < pend && *p != '>') ++p;
+ while (p < pend && *p != '>' && (hasBrackets || !parserHelpers::isSpace(*p))) ++p;
m_right = string(buffer.begin() + rightStart,
buffer.begin() + position + (p - pstart));