From f81ae069e4ef8a49f826c458c7b80996cec2036a Mon Sep 17 00:00:00 2001 From: NotZed Date: Mon, 28 Feb 2000 23:26:13 +0000 Subject: Fix a bunch of serious small bugs. 2000-02-28 NotZed * camel-mime-part.c (_parse_header_pair): Dont free this either. * camel-medium.c (_remove_header): Ugh, dont free the header before we actually remove it. (_add_header): Ugh, dont free hashtable entries which may be duplicated (hash_insert _will_ reference that memory). * string-utils.c (string_trim): Trimming a 0-length string is not an error. * camel-mime-message.c (_parse_header_pair): Fixed very broken memory handling of header_name/value. * providers/mbox/camel-mbox-utils.c (camel_mbox_write_xev): Initialise end_of_last_message always. (camel_mbox_copy_file_chunk): Stop trying to read if we run out of data, rather than looping forever. * providers/mbox/camel-mbox-folder.c (_init): Set search cap on. (_open): Call parent class to perform open. Remove folder-open check to parent instead. (_create): open takes a creation mask, dont use umask to try and set the open mode. (_delete): Dont bother checking folder==NULL, its already been checked on the external interface (changed to an assertion, this would have to be a camel bug). (_delete_messages): Likewise. (_create): Ditto. (_init): Dont go and clear all the paths and shit that the parent open just setup for us. (_delete_messages): Get rid of more umask stuff. (_append_message): Make sure we pass file mode to open with create. (_append_message): Cleaned up some indenting to make it readable. svn path=/trunk/; revision=1985 --- camel/providers/mbox/camel-mbox-utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'camel/providers/mbox/camel-mbox-utils.c') diff --git a/camel/providers/mbox/camel-mbox-utils.c b/camel/providers/mbox/camel-mbox-utils.c index 6a49bb869f..3d45daa05f 100644 --- a/camel/providers/mbox/camel-mbox-utils.c +++ b/camel/providers/mbox/camel-mbox-utils.c @@ -168,10 +168,10 @@ camel_mbox_copy_file_chunk (gint fd_src, { gchar buffer [1000]; glong nb_to_read; - glong nb_read, v; + glong nb_read=1, v; nb_to_read = nb_bytes; - while (nb_to_read > 0) { + while (nb_to_read > 0 && nb_read>0) { do { nb_read = read (fd_src, buffer, MIN (1000, nb_to_read)); @@ -223,7 +223,7 @@ camel_mbox_write_xev (gchar *mbox_file_name, guint bytes_to_copy = 0; glong cur_pos = 0; glong cur_offset = 0; - glong end_of_last_message; + glong end_of_last_message = 0; glong next_free_uid; gchar xev_header[20] = "X-Evolution:XXXX-X\n"; gchar *tmp_file_name; -- cgit v1.2.3