Fixed a bug in word parsing.
This commit is contained in:
parent
df46facf9f
commit
97e61dcb08
@ -2,6 +2,11 @@
|
|||||||
VERSION 0.7.1cvs
|
VERSION 0.7.1cvs
|
||||||
================
|
================
|
||||||
|
|
||||||
|
2005-06-13 Vincent Richard <vincent@vincent-richard.net>
|
||||||
|
|
||||||
|
* word.cpp: fixed a bug in parsing, when the first character of word data
|
||||||
|
was encoded in QP (thanks to Wolf Jiang).
|
||||||
|
|
||||||
2005-06-03 Vincent Richard <vincent@vincent-richard.net>
|
2005-06-03 Vincent Richard <vincent@vincent-richard.net>
|
||||||
|
|
||||||
* parameterizedHeaderField.{hpp|cpp}: fixed a memory leak in the
|
* parameterizedHeaderField.{hpp|cpp}: fixed a memory leak in the
|
||||||
|
20
src/word.cpp
20
src/word.cpp
@ -93,7 +93,7 @@ word* word::parseNext(const string& buffer, const string::size_type position,
|
|||||||
startPos = pos;
|
startPos = pos;
|
||||||
}
|
}
|
||||||
// Start of an encoded word
|
// Start of an encoded word
|
||||||
else if (pos + 6 < end && // 6 = "=?(.+)?(.*)?="
|
else if (pos + 8 < end && // 8 = "=?(.+)?(.+)?(.*)?="
|
||||||
buffer[pos] == '=' && buffer[pos + 1] == '?')
|
buffer[pos] == '=' && buffer[pos + 1] == '?')
|
||||||
{
|
{
|
||||||
// Check whether there is some unencoded text before
|
// Check whether there is some unencoded text before
|
||||||
@ -116,7 +116,23 @@ word* word::parseNext(const string& buffer, const string::size_type position,
|
|||||||
// ...else find the finish sequence '?=' and return an encoded word
|
// ...else find the finish sequence '?=' and return an encoded word
|
||||||
const string::size_type wordStart = pos;
|
const string::size_type wordStart = pos;
|
||||||
|
|
||||||
pos += 4;
|
pos += 2;
|
||||||
|
|
||||||
|
while (pos < end && buffer[pos] != '?')
|
||||||
|
++pos;
|
||||||
|
|
||||||
|
if (pos < end)
|
||||||
|
{
|
||||||
|
++pos; // skip '?' between charset and encoding
|
||||||
|
|
||||||
|
while (pos < end && buffer[pos] != '?')
|
||||||
|
++pos;
|
||||||
|
|
||||||
|
if (pos < end)
|
||||||
|
{
|
||||||
|
++pos; // skip '?' between encoding and encoded data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
while (pos < end)
|
while (pos < end)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user