Index: camel/ChangeLog
===================================================================
--- camel/ChangeLog	(revision 9598)
+++ camel/ChangeLog	(working copy)
@@ -2,6 +2,13 @@
 
 	** Part of fix for bug #313225
 
+	* camel-folder-summary.c: (summary_build_content_info): Fix
+	misunderstanding of the parameter in code causing crash in this part.
+
+2008-09-24  Milan Crha  <mcrha@redhat.com>
+
+	** Part of fix for bug #313225
+
 	* camel-folder-summary.c: (summary_build_content_info),
 	(summary_build_content_info_message): Check whether message contains
 	headers indicating a calendar attachment and if so, then set the user
Index: camel/camel-folder-summary.c
===================================================================
--- camel/camel-folder-summary.c	(revision 9598)
+++ camel/camel-folder-summary.c	(working copy)
@@ -3557,7 +3557,6 @@ summary_build_content_info(CamelFolderSu
 	CamelMimeFilterCharset *mfc;
 	CamelMessageContentInfo *part;
 	const char *calendar_header;
-	int calendar_header_offset = -1;
 
 	d(printf("building content info\n"));
 
@@ -3580,17 +3579,12 @@ summary_build_content_info(CamelFolderSu
 			)
 			camel_message_info_set_flags(msginfo, CAMEL_MESSAGE_SECURE, CAMEL_MESSAGE_SECURE);
 
-		calendar_header = camel_mime_parser_header (mp, "Content-class", &calendar_header_offset);
-		if (calendar_header) {
-			while (calendar_header [calendar_header_offset] && isspace (calendar_header [calendar_header_offset]))
-				calendar_header_offset++;
-
-			if (g_ascii_strcasecmp (calendar_header + calendar_header_offset, "urn:content-classes:calendarmessage") != 0)
-				calendar_header = NULL;
-		}
+		calendar_header = camel_mime_parser_header (mp, "Content-class", NULL);
+		if (calendar_header && g_ascii_strcasecmp (calendar_header, "urn:content-classes:calendarmessage") != 0)
+			calendar_header = NULL;
 
 		if (!calendar_header)
-			calendar_header = camel_mime_parser_header (mp, "X-Calendar-Attachment", &calendar_header_offset);
+			calendar_header = camel_mime_parser_header (mp, "X-Calendar-Attachment", NULL);
 
 		if (calendar_header)
 			camel_message_info_set_user_flag (msginfo, "$has_cal", TRUE);
