changeset 1267:8ceacaf13c9c HEAD

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.
author Timo Sirainen <tss@iki.fi>
date Tue, 04 Mar 2003 03:10:28 +0200
parents 4cc2a05c5c88
children 0d9f0e617a1a
files src/lib-imap/imap-quote.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-imap/imap-quote.c	Mon Mar 03 00:41:45 2003 +0200
+++ b/src/lib-imap/imap-quote.c	Tue Mar 04 03:10:28 2003 +0200
@@ -19,12 +19,13 @@
 		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 */