QP-Decoding: Ignore case of letter indicating _B_inary or _Q_uoted printeable, there...
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 30 Jan 2011 12:14:05 +0000 (13:14 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 30 Jan 2011 12:17:15 +0000 (13:17 +0100)
libcitadel/lib/stringbuf.c
libcitadel/tests/testdata/qpstrings/list [new file with mode: 0644]

index 88ce0679c33f19679f3196af62d587b116749be4..f621255c8224363b10fd9a0ba31783f405e0aa58 100644 (file)
@@ -2830,7 +2830,8 @@ static inline const char *FindNextEnd (const StrBuf *Buf, const char *bptr)
                return NULL;
 
        if ((Buf->BufUsed - (end - Buf->buf) > 3) &&
-           ((*(end + 1) == 'B') || (*(end + 1) == 'Q')) && 
+           (((*(end + 1) == 'B') || (*(end + 1) == 'Q')) ||
+            ((*(end + 1) == 'b') || (*(end + 1) == 'q'))) && 
            (*(end + 2) == '?')) {
                /* skip on to the end of the cluster, the next ?= */
                end = strstr(end + 3, "?=");
@@ -3083,7 +3084,7 @@ void StrBuf_RFC822_2_Utf8(StrBuf *Target,
        start = strstr(DecodeMee->buf, "=?");
        eptr = DecodeMee->buf + DecodeMee->BufUsed;
        if (start != NULL) 
-               end = FindNextEnd (DecodeMee, start);
+               end = FindNextEnd (DecodeMee, start + 2);
        else {
                StrBufAppendBuf(Target, DecodeMee, 0);
                FreeStrBuf(&DecodedInvalidBuf);
diff --git a/libcitadel/tests/testdata/qpstrings/list b/libcitadel/tests/testdata/qpstrings/list
new file mode 100644 (file)
index 0000000..a418935
--- /dev/null
@@ -0,0 +1,2 @@
+=?utf-8?q?=5Bubuntuusers=5D_Neue_Antwort_im_Thema_=E2=80=9EBaust?==?utf-8?b?ZWxsZS9DaXRhZGVs4oCc?=
+