Core/POP3: MIMEHeader parsing improved

git-svn-id: svn://ultimatepp.org/upp/trunk@7272 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-04-17 13:01:29 +00:00
parent 3a00114df3
commit a357fbfd50

View file

@ -198,6 +198,9 @@ bool MIMEHeader::Parse(const char *s)
while(!p.IsEof() && !p.IsChar(';'))
p.SkipTerm();
value = TrimBoth(String(b, p.GetPtr()));
if(*value == '\'' && *value.Last() == '\'' || // mime type can be quoted...
*value == '\"' && *value.Last() == '\"')
value = TrimBoth(value.Mid(1, value.GetCount() - 2));
while(!p.IsEof()) {
if(p.Char(';') && p.IsId()) {
const char *b = p.GetPtr();
@ -206,6 +209,9 @@ bool MIMEHeader::Parse(const char *s)
String id = ToLower(TrimBoth(String(b, p.GetPtr())));
String val;
if(p.Char('='))
if(p.IsChar('\''))
val = p.ReadString('\'');
else
if(p.IsString())
val = p.ReadString();
else {