From 926111db97d34ce1bf7c7608f3ce63bc50222c9a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Wed, 5 Nov 2008 23:51:17 +0000 Subject: [PATCH] * detect the QP-coding type 'B' and 'Q' case insensitive * start detecting non-qp encoded string parts --- libcitadel/lib/stringbuf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libcitadel/lib/stringbuf.c b/libcitadel/lib/stringbuf.c index ba8fdec4a..9e15107de 100644 --- a/libcitadel/lib/stringbuf.c +++ b/libcitadel/lib/stringbuf.c @@ -1624,6 +1624,7 @@ inline static void DecodeSegment(StrBuf *Target, extract_token(encoding, SegmentStart, 2, '?', sizeof encoding); StrBufExtract_token(ConvertBuf, &StaticBuf, 3, '?'); + *encoding = toupper(*encoding); if (*encoding == 'B') { /**< base64 */ ConvertBuf2->BufUsed = CtdlDecodeBase64(ConvertBuf2->buf, ConvertBuf->buf, @@ -1739,6 +1740,8 @@ void StrBuf_RFC822_to_Utf8(StrBuf *Target, StrBuf *DecodeMe, const StrBuf* Defau ConvertBuf2 = NewStrBufPlain(NULL, StrLength(DecodeMe)); + if (start != DecodeMe->buf) + StrBufAppendBufPlain(Target, DecodeMe->buf, start - DecodeMe->buf, 0); /* * Since spammers will go to all sorts of absurd lengths to get their * messages through, there are LOTS of corrupt headers out there. -- 2.39.2