[dovecot-cvs] dovecot/src/lib-imap imap-base-subject.c,1.5,1.6

cras at procontrol.fi cras at procontrol.fi
Mon Jan 20 15:54:15 EET 2003


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

Modified Files:
	imap-base-subject.c 
Log Message:
Strip CR and LF characters too.



Index: imap-base-subject.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-imap/imap-base-subject.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- imap-base-subject.c	13 Jan 2003 20:01:22 -0000	1.5
+++ imap-base-subject.c	20 Jan 2003 13:54:13 -0000	1.6
@@ -53,7 +53,7 @@
 
 	/* check if we need to do anything */
 	while (*data != '\0') {
-		if (*data == '\t' ||
+		if (*data == '\t' || *data == '\n' || *data == '\r' ||
 		    (*data == ' ' && (data[1] == ' ' || data[1] == '\t')))
 			break;
 		data++;
@@ -65,7 +65,8 @@
 	/* @UNSAFE: convert/pack the whitespace */
 	dest = data; last_lwsp = FALSE;
 	while (*data != '\0') {
-		if (*data == '\t' || *data == ' ') {
+		if (*data == '\t' || *data == ' ' ||
+		    *data == '\r' || *data == '\n') {
 			if (!last_lwsp) {
 				*dest++ = ' ';
 				last_lwsp = TRUE;




More information about the dovecot-cvs mailing list