From 3abf3bdcb8200104830c69de6615e09e49bccde7 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Wed, 9 Aug 2006 07:18:45 +0000 Subject: Fix for message ids without angle brackets. --- src/messageId.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/messageId.cpp') 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)); -- cgit v1.2.3