[evolution-patches] 73015, workaround for broken groupwise references





? camel/c.diff
? camel/camel-mime-tables.c
? camel/cs.h.diff
? camel/gpg
? camel/gw.diff
? camel/sub.diff
? camel/subscribe.diff
? camel/trace
? camel/providers/m.diff
? camel/providers/imap/fuck.sh
? camel/tests/folder/test10
? camel/tests/folder/test11
? camel/tests/message/test4
? camel/tests/mime-filter/test-tohtml
? camel/tests/mime-filter/test1
? camel/tests/misc/test1
? camel/tests/misc/test2
? camel/tests/misc/url-scan
Index: camel/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/ChangeLog,v
retrieving revision 1.2434
diff -u -p -r1.2434 ChangeLog
--- camel/ChangeLog	1 Mar 2005 02:37:22 -0000	1.2434
+++ camel/ChangeLog	1 Mar 2005 04:33:59 -0000
@@ -1,3 +1,12 @@
+2005-03-01  Not Zed  <NotZed Ximian com>
+
+	** See bug #73015
+
+	* tests/misc/test1.c: Test case for references decoding.
+
+	* camel-mime-utils.c (header_decode_addrspec): if we get no start
+	word, then return NULL not "".
+
 2005-02-28  Not Zed  <NotZed Ximian com>
 
 	** See bug #72609
Index: camel/camel-mime-utils.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-mime-utils.c,v
retrieving revision 1.224
diff -u -p -r1.224 camel-mime-utils.c
--- camel/camel-mime-utils.c	1 Mar 2005 02:37:22 -0000	1.224
+++ camel/camel-mime-utils.c	1 Mar 2005 04:34:00 -0000
@@ -2102,6 +2102,9 @@ header_decode_addrspec(const char **in)
 		}
 	} else {
 		w(g_warning("invalid addr-spec, no local part"));
+		g_string_free(addr, TRUE);
+
+		return NULL;
 	}
 
 	/* FIXME: return null on error? */
Index: camel/tests/misc/Makefile.am
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/tests/misc/Makefile.am,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile.am
--- camel/tests/misc/Makefile.am	13 Dec 2004 03:08:52 -0000	1.13
+++ camel/tests/misc/Makefile.am	1 Mar 2005 04:34:01 -0000
@@ -16,11 +16,12 @@ LDADD = \
 	$(INTLLIBS)
 
 check_PROGRAMS =  	\
+	test1		\
+	test2		\
 	url		\
 	url-scan	\
 	utf7		\
-	split		\
-	test2
+	split
 
 TESTS = url utf7 split url-scan test2
 
Index: camel/tests/misc/README
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/tests/misc/README,v
retrieving revision 1.4
diff -u -p -r1.4 README
--- camel/tests/misc/README	1 Jun 2004 10:07:13 -0000	1.4
+++ camel/tests/misc/README	1 Mar 2005 04:34:01 -0000
@@ -1,4 +1,5 @@
 
+test1	references header decoding
 test2	rfc2184 multipart/i18n parameters
 url	URL parsing
 utf7	UTF7 and UTF8 processing
Index: camel/tests/misc/test1.c
===================================================================
RCS file: camel/tests/misc/test1.c
diff -N camel/tests/misc/test1.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ camel/tests/misc/test1.c	1 Mar 2005 04:34:01 -0000
@@ -0,0 +1,58 @@
+
+
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <camel/camel-object.h>
+#include <camel/camel-mime-utils.h>
+
+#include "camel-test.h"
+
+struct {
+	char *header;
+	char *values[5];
+} test1[] = {
+	{ "<test camel host>", { "test camel host" } },
+	{ "(this is a comment) <test camel host>", { "test camel host" } },
+	{ "<test camel host> (this is a comment)", { "test camel host" } },
+	{ "<test camel host> This is total rubbish!", { "test camel host" } },
+	{ "<<test groupwise bug novell>@novell>", { "test groupwise bug novell" } },
+	{ "<<test groupwise bug novell>@novell> <test camel host>",
+	  { "test camel host", "test groupwise bug novell" } },
+	{ "<test camel host> <<test groupwise bug novell>@novell> <test camel host>",
+	  { "test camel host", "test groupwise bug novell", "test camel host" } },
+	{ "<<test groupwise bug novell>@novell> <test camel host> <<test groupwise bug novell>@novell>",
+	  { "test groupwise bug novell", "test camel host", "test groupwise bug novell" } },
+};
+
+int
+main (int argc, char **argv)
+{
+	int i, j;
+
+	camel_test_init(argc, argv);
+
+	camel_test_start("references decoding");
+
+	for (i=0;i<sizeof(test1)/sizeof(test1[0]);i++) {
+		struct _camel_header_references *head, *node;
+
+		camel_test_push("references decoding[%d] '%s'", i, test1[i].header);
+		head = camel_header_references_decode(test1[i].header);
+		node = head;
+		for (j=0;test1[i].values[j];j++) {
+			check_msg(node != NULL, "didn't find all references");
+			check(strcmp(test1[i].values[j], node->id) == 0);
+			node = node->next;
+		}
+		check_msg(node == NULL, "found more references than should have");
+		camel_header_references_list_clear(&head);
+		camel_test_pull();
+	}
+
+	camel_test_end();
+
+	return 0;
+}


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