evolution-data-server r8617 - trunk/camel



Author: fejj
Date: Fri Apr  4 15:55:53 2008
New Revision: 8617
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=8617&view=rev

Log:
2008-04-04  Jeffrey Stedfast  <fejj novell com>

	* camel-mime-parser.c (folder_scan_header): Applied patch by Craig
	Shelly to fix the PRESERVE_HEADERS logic. First step in fixing bug
	#235681.



Modified:
   trunk/camel/ChangeLog
   trunk/camel/camel-mime-parser.c

Modified: trunk/camel/camel-mime-parser.c
==============================================================================
--- trunk/camel/camel-mime-parser.c	(original)
+++ trunk/camel/camel-mime-parser.c	Fri Apr  4 15:55:53 2008
@@ -1225,11 +1225,8 @@
 					h(printf("got line part: '%.*s'\n", inptr-1-start, start));
 					/* got a line, strip and add it, process it */
 					s->midline = FALSE;
-#ifdef PRESERVE_HEADERS
-					header_append(s, start, inptr);
-#else
 					header_append(s, start, inptr-1);
-#endif
+
 					/* check for end of headers */
 					if (s->outbuf == s->outptr)
 						goto header_done;
@@ -1237,6 +1234,13 @@
 					/* check for continuation/compress headers, we have atleast 1 char here to work with */
 					if (inptr[0] ==  ' ' || inptr[0] == '\t') {
 						h(printf("continuation\n"));
+
+#ifdef PRESERVE_HEADERS
+						if (inptr-1 >= start) {
+							start=inptr-1;
+							header_append(s, start, inptr);
+						}
+#endif
 #ifndef PRESERVE_HEADERS
 						/* TODO: this wont catch multiple space continuation across a read boundary, but
 						   that is assumed rare, and not fatal anyway */
@@ -1248,11 +1252,6 @@
 #endif
 					} else {
 						/* otherwise, complete header, add it */
-#ifdef PRESERVE_HEADERS
-						s->outptr--;
-						if (s->outptr[-1] == '\r')
-							s->outptr--;
-#endif
 						s->outptr[0] = 0;
 
 						h(printf("header '%s' at %d\n", s->outbuf, (int)s->header_start));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]