From d762b979438fbc28cf1cc39b47d046afa69ff30b Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 14 May 2002 23:37:58 +0000 Subject: Fixes bug #24136. 2002-05-14 Jeffrey Stedfast Fixes bug #24136. * providers/imap/camel-imap-folder.c (content_info_get_part_spec): New function to take a CamelMessageContentInfo and generate a part-specification string. (get_content): Stop passing around part_spec strings and use content_info_get_part_spec instead. * camel-folder-summary.c (camel_content_info_dump): Made this into a public debugging function. * providers/imap/camel-imap-utils.c (imap_parse_body): Make sure to set the parent of any message/rfc822 subparts. svn path=/trunk/; revision=16793 --- camel/camel-folder-summary.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'camel/camel-folder-summary.c') diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c index 6dd0cddc20..aa5156b9be 100644 --- a/camel/camel-folder-summary.c +++ b/camel/camel-folder-summary.c @@ -2702,34 +2702,35 @@ camel_message_info_set_string (CamelMessageInfo *mi, int type, char *str) } #endif -#if 0 -static void -content_info_dump(CamelMessageContentInfo *ci, int depth) + +void +camel_content_info_dump (CamelMessageContentInfo *ci, int depth) { char *p; - - p = alloca(depth*4+1); - memset(p, ' ', depth*4); - p[depth*4] = 0; - + + p = alloca (depth * 4 + 1); + memset (p, ' ', depth * 4); + p[depth * 4] = 0; + if (ci == NULL) { - printf("%s\n", p); + printf ("%s\n", p); return; } - - printf("%scontent-type: %s/%s\n", p, ci->type->type, ci->type->subtype); - printf("%scontent-transfer-encoding: %s\n", p, ci->encoding); - printf("%scontent-description: %s\n", p, ci->description); - printf("%ssize: %lu\n", p, (unsigned long)ci->size); + + printf ("%scontent-type: %s/%s\n", p, ci->type->type ? ci->type->type : "(null)", + ci->type->subtype ? ci->type->subtype : "(null)"); + printf ("%scontent-transfer-encoding: %s\n", p, ci->encoding ? ci->encoding : "(null)"); + printf ("%scontent-description: %s\n", p, ci->description ? ci->description : "(null)"); + printf ("%ssize: %lu\n", p, (unsigned long) ci->size); ci = ci->childs; while (ci) { - content_info_dump(ci, depth+1); + camel_content_info_dump (ci, depth + 1); ci = ci->next; } } void -message_info_dump(CamelMessageInfo *mi) +camel_message_info_dump (CamelMessageInfo *mi) { if (mi == NULL) { printf("No message?\n"); @@ -2743,6 +2744,5 @@ message_info_dump(CamelMessageInfo *mi) printf("From: %s\n", camel_message_info_from(mi)); printf("UID: %s\n", camel_message_info_uid(mi)); printf("Flags: %04x\n", mi->flags & 0xffff); - content_info_dump(mi->content, 0); + camel_content_info_dump(mi->content, 0); } -#endif -- cgit v1.2.3