[dovecot-cvs] dovecot/src/lib-imap imap-bodystructure.c,1.35,1.36 imap-envelope.c,1.27,1.28 imap-quote.c,1.15,1.16 imap-quote.h,1.6,1.7

cras at procontrol.fi cras at procontrol.fi
Mon Jun 23 22:22:50 EEST 2003


Update of /home/cvs/dovecot/src/lib-imap
In directory danu:/tmp/cvs-serv22150/lib-imap

Modified Files:
	imap-bodystructure.c imap-envelope.c imap-quote.c imap-quote.h 
Log Message:
LIST and STATUS replies shouldn't strip tabs and spaces from mailbox names.



Index: imap-bodystructure.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-imap/imap-bodystructure.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- imap-bodystructure.c	4 Jun 2003 16:13:23 -0000	1.35
+++ imap-bodystructure.c	23 Jun 2003 18:22:48 -0000	1.36
@@ -74,9 +74,9 @@
 	if (name_len == 7 && memcasecmp(name, "charset", 7) == 0)
 		data->charset_found = TRUE;
 
-	imap_quote_append(data->str, name, name_len);
+	imap_quote_append(data->str, name, name_len, TRUE);
 	str_append_c(data->str, ' ');
-	imap_quote_append(data->str, value, value_len);
+	imap_quote_append(data->str, value, value_len, TRUE);
 }
 
 static void parse_content_transfer_encoding(const unsigned char *value,

Index: imap-envelope.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-imap/imap-envelope.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- imap-envelope.c	3 May 2003 18:19:49 -0000	1.27
+++ imap-envelope.c	23 Jun 2003 18:22:48 -0000	1.28
@@ -156,13 +156,13 @@
 	str_append_c(str, '(');
 	while (addr != NULL) {
 		str_append_c(str, '(');
-		imap_quote_append_string(str, addr->name);
+		imap_quote_append_string(str, addr->name, TRUE);
 		str_append_c(str, ' ');
-		imap_quote_append_string(str, addr->route);
+		imap_quote_append_string(str, addr->route, TRUE);
 		str_append_c(str, ' ');
-		imap_quote_append_string(str, addr->mailbox);
+		imap_quote_append_string(str, addr->mailbox, TRUE);
 		str_append_c(str, ' ');
-		imap_quote_append_string(str, addr->domain);
+		imap_quote_append_string(str, addr->domain, TRUE);
 		str_append_c(str, ')');
 
 		addr = addr->next;

Index: imap-quote.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-imap/imap-quote.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- imap-quote.c	18 Jun 2003 01:35:44 -0000	1.15
+++ imap-quote.c	23 Jun 2003 18:22:48 -0000	1.16
@@ -5,7 +5,7 @@
 #include "imap-quote.h"
 
 void imap_quote_append(string_t *str, const unsigned char *value,
-		       size_t value_len)
+		       size_t value_len, int compress_lwsp)
 {
 	size_t i, extra = 0;
 	int last_lwsp = TRUE, literal = FALSE, modify = FALSE;
@@ -28,7 +28,7 @@
 			break;
 		case ' ':
 		case '\t':
-			if (last_lwsp) {
+			if (last_lwsp && compress_lwsp) {
 				modify = TRUE;
 				extra++;
 			}
@@ -67,7 +67,7 @@
 				break;
 			case ' ':
 			case '\t':
-				if (!last_lwsp)
+				if (!last_lwsp || !compress_lwsp)
 					str_append_c(str, ' ');
 				last_lwsp = TRUE;
 				break;
@@ -98,7 +98,7 @@
 
 	t_push();
 	str = t_str_new(value_len + MAX_INT_STRLEN + 5);
-	imap_quote_append(str, value, value_len);
+	imap_quote_append(str, value, value_len, TRUE);
 	ret = p_strndup(pool, str_data(str), str_len(str));
 	t_pop();
 

Index: imap-quote.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-imap/imap-quote.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- imap-quote.h	4 Jun 2003 14:48:38 -0000	1.6
+++ imap-quote.h	23 Jun 2003 18:22:48 -0000	1.7
@@ -8,9 +8,10 @@
 
 /* Append to existing string. */
 void imap_quote_append(string_t *str, const unsigned char *value,
-		       size_t value_len);
+		       size_t value_len, int compress_lwsp);
 
-#define imap_quote_append_string(str, value) \
-	imap_quote_append(str, (const unsigned char *) value, (size_t)-1)
+#define imap_quote_append_string(str, value, compress_lwsp) \
+	imap_quote_append(str, (const unsigned char *) value, \
+			  (size_t)-1, compress_lwsp)
 
 #endif



More information about the dovecot-cvs mailing list