]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Use literals for strings containing '"' and '\' characters too. This wasn't
authorTimo Sirainen <tss@iki.fi>
Tue, 4 Mar 2003 01:10:28 +0000 (03:10 +0200)
committerTimo Sirainen <tss@iki.fi>
Tue, 4 Mar 2003 01:10:28 +0000 (03:10 +0200)
done at all before so FETCH ENVELOPE, BODY and BODYSTRUCTURE could have
returned pretty broken results.

--HG--
branch : HEAD

src/lib-imap/imap-quote.c

index 66c15a5e61eb015d1e37587be11e068f1f3145b5..3878f694474277e4052f82b09f267708ed47d209 100644 (file)
@@ -19,12 +19,13 @@ void imap_quote_append(string_t *str, const unsigned char *value,
                if (value[i] == 13 || value[i] == 10)
                         linefeeds++;
 
-               if ((value[i] & 0x80) != 0)
+               if ((value[i] & 0x80) != 0 ||
+                   value[i] == '"' || value[i] == '\\')
                        literal = TRUE;
        }
 
        if (!literal) {
-               /* no 8bit chars, return as "string" */
+               /* no 8bit chars or imapspecials, return as "string" */
                str_append_c(str, '"');
        } else {
                /* return as literal */