[evolution-patches] 312831, crash threading messages



the test for empty children happens before the children are processed,
this should fix it.

Index: camel/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/ChangeLog,v
retrieving revision 1.2461
diff -u -p -r1.2461 ChangeLog
--- camel/ChangeLog	4 Aug 2005 02:50:03 -0000	1.2461
+++ camel/ChangeLog	8 Aug 2005 05:42:26 -0000
@@ -1,3 +1,12 @@
+2005-08-08  Not Zed  <NotZed Ximian com>
+
+	** See bug #312831.
+
+	* camel-folder-thread.c (prune_empty): change to depth-first
+	search so we check for empty children before checking if we have
+	children.
+	(dump_tree_rec): update debug func.
+
 2005-08-03  Not Zed  <NotZed Ximian com>
 
 	** See bug #274382.
Index: camel/camel-folder-thread.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-folder-thread.c,v
retrieving revision 1.21
diff -u -p -r1.21 camel-folder-thread.c
--- camel/camel-folder-thread.c	2 Dec 2004 08:03:30 -0000	1.21
+++ camel/camel-folder-thread.c	8 Aug 2005 05:42:27 -0000
@@ -107,6 +107,7 @@ prune_empty(CamelFolderThread *thread, C
 	lastc = (CamelFolderThreadNode *)cp;
 	while (lastc->next) {
 		c = lastc->next;
+		prune_empty(thread, &c->child);
 
 		d(printf("checking message %p %p (%08x%08x)\n", c,
 			 c->message, c->message?c->message->message_id.id.part.hi:0,
@@ -135,7 +136,6 @@ prune_empty(CamelFolderThread *thread, C
 				continue;
 			}
 		}
-		prune_empty(thread, &c->child);
 		lastc = c;
 	}
 }
@@ -333,7 +333,8 @@ dump_tree_rec(struct _tree_info *info, C
 			g_hash_table_insert(info->visited, c, c);
 		}
 		if (c->message) {
-			printf("%s %p Subject: %s <%.8s>\n", p, c, camel_message_info_subject(c->message), camel_message_info_message_id(c->message)->id.hash);
+			printf("%s %p Subject: %s <%08x%08x>\n", p, c, camel_message_info_subject(c->message),
+			       camel_message_info_message_id(c->message)->id.part.hi, camel_message_info_message_id(c->message)->id.part.lo);
 			count += 1;
 		} else {
 			printf("%s %p <empty>\n", p, c);
@@ -512,8 +513,8 @@ thread_summary(CamelFolderThread *thread
 
 #if 0
 	printf("finished\n");
-	i = camel_folder_thread_messages_dump(head);
-	printf("%d count, %d items in tree\n", uids->len, i);
+	i = camel_folder_threaded_messages_dump(head);
+	printf("%d count, %d items in tree\n", summary->len, i);
 #endif
 
 	sort_thread(&head);


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