aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-folder-summary.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2002-08-02 13:13:38 +0800
committerMichael Zucci <zucchi@src.gnome.org>2002-08-02 13:13:38 +0800
commitd987b48e12054e6eba632387a8639aaab07735cb (patch)
tree2f2984952ec356d8ee5d3aea6f036caac0eec83e /camel/camel-folder-summary.c
parenta683952c1320f3998b4f0fd658f2057caad31b60 (diff)
downloadgsoc2013-evolution-d987b48e12054e6eba632387a8639aaab07735cb.tar
gsoc2013-evolution-d987b48e12054e6eba632387a8639aaab07735cb.tar.gz
gsoc2013-evolution-d987b48e12054e6eba632387a8639aaab07735cb.tar.bz2
gsoc2013-evolution-d987b48e12054e6eba632387a8639aaab07735cb.tar.lz
gsoc2013-evolution-d987b48e12054e6eba632387a8639aaab07735cb.tar.xz
gsoc2013-evolution-d987b48e12054e6eba632387a8639aaab07735cb.tar.zst
gsoc2013-evolution-d987b48e12054e6eba632387a8639aaab07735cb.zip
revert jeff's patch below, and do it slightly differently, and stop the
2002-08-02 Not Zed <NotZed@Ximian.com> * camel-folder-summary.c (message_info_load): revert jeff's patch below, and do it slightly differently, and stop the auto-reformatting bullshit. 2002-08-02 Not Zed <NotZed@Ximian.com> * providers/local/camel-maildir-summary.c (message_info_new): If we get a duplicate, just re-use the old info. (remove_summary): Add any removed to a change list. (maildir_summary_check): If we find new ones in 'cur' track them in the change list. Removed FIXME about it. For #18348. svn path=/trunk/; revision=17685
Diffstat (limited to 'camel/camel-folder-summary.c')
-rw-r--r--camel/camel-folder-summary.c70
1 files changed, 28 insertions, 42 deletions
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index 82571e7632..ebef730c70 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -1693,66 +1693,52 @@ message_info_load(CamelFolderSummary *s, FILE *in)
#endif
mi->content = NULL;
-
- /* decode the message-id */
- if (camel_file_util_decode_fixed_int32 (in, &mi->message_id.id.part.hi) == -1)
- goto error;
- if (camel_file_util_decode_fixed_int32 (in, &mi->message_id.id.part.lo) == -1)
- goto error;
-
- /* decode the references count */
- if (camel_file_util_decode_uint32 (in, &count) == -1 || count > 500)
+
+ camel_file_util_decode_fixed_int32(in, &mi->message_id.id.part.hi);
+ camel_file_util_decode_fixed_int32(in, &mi->message_id.id.part.lo);
+
+ if (camel_file_util_decode_uint32(in, &count) == -1 || count > 500)
goto error;
-
+
if (count > 0) {
- /* decode the references */
mi->references = g_malloc(sizeof(*mi->references) + ((count-1) * sizeof(mi->references->references[0])));
mi->references->size = count;
- for (i = 0; i < count; i++) {
- if (camel_file_util_decode_fixed_int32 (in, &mi->references->references[i].id.part.hi) == -1)
- goto error;
- if (camel_file_util_decode_fixed_int32 (in, &mi->references->references[i].id.part.lo) == -1)
- goto error;
+ for (i=0;i<count;i++) {
+ camel_file_util_decode_fixed_int32(in, &mi->references->references[i].id.part.hi);
+ camel_file_util_decode_fixed_int32(in, &mi->references->references[i].id.part.lo);
}
}
-
- if (camel_file_util_decode_uint32 (in, &count) == -1 || count > 500)
+
+ if (camel_file_util_decode_uint32(in, &count) == -1 || count > 500)
goto error;
-
- /* decode the user-flags */
- for (i = 0; i < count; i++) {
+
+ for (i=0;i<count;i++) {
char *name;
-
- if (camel_file_util_decode_string (in, &name) == -1)
+ if (camel_file_util_decode_string(in, &name) == -1 || name == NULL)
goto error;
-
- camel_flag_set (&mi->user_flags, name, TRUE);
- g_free (name);
+ camel_flag_set(&mi->user_flags, name, TRUE);
+ g_free(name);
}
-
- if (camel_file_util_decode_uint32 (in, &count) == -1 || count > 500)
+
+ if (camel_file_util_decode_uint32(in, &count) == -1 || count > 500)
goto error;
-
- /* decode the user-tags */
- for (i = 0; i < count; i++) {
+
+ for (i=0;i<count;i++) {
char *name, *value;
-
- if (camel_file_util_decode_string (in, &name) == -1)
- goto error;
- if (camel_file_util_decode_string (in, &value) == -1)
+ if (camel_file_util_decode_string(in, &name) == -1 || name == NULL
+ || camel_file_util_decode_string(in, &value) == -1)
goto error;
-
- camel_tag_set (&mi->user_tags, name, value);
- g_free (name);
- g_free (value);
+ camel_tag_set(&mi->user_tags, name, value);
+ g_free(name);
+ g_free(value);
}
-
+
if (!ferror(in))
return mi;
-
+
error:
camel_folder_summary_info_free(s, mi);
-
+
return NULL;
}