From: Timo Sirainen Date: Tue, 4 Mar 2003 01:10:28 +0000 (+0200) Subject: Use literals for strings containing '"' and '\' characters too. This wasn't X-Git-Tag: 1.1.alpha1~4839 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7d705e8c2b9bdd4f85332db06b415385f98d63c;p=thirdparty%2Fdovecot%2Fcore.git Use literals for strings containing '"' and '\' characters too. This wasn't done at all before so FETCH ENVELOPE, BODY and BODYSTRUCTURE could have returned pretty broken results. --HG-- branch : HEAD --- diff --git a/src/lib-imap/imap-quote.c b/src/lib-imap/imap-quote.c index 66c15a5e61..3878f69447 100644 --- a/src/lib-imap/imap-quote.c +++ b/src/lib-imap/imap-quote.c @@ -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 */