From 251d6830c324a8f7302fceb6fd96ae3ec0078994 Mon Sep 17 00:00:00 2001 From: hiro Date: Fri, 10 Jun 2011 09:41:40 +0000 Subject: fixed an error when removing queued messages on win32. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2895 ee746299-78ed-0310-b773-934348b2243d --- libsylph/libsylph-0.def | 1 + libsylph/procmsg.c | 18 +++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'libsylph') diff --git a/libsylph/libsylph-0.def b/libsylph/libsylph-0.def index f313d0be..80ee21c6 100644 --- a/libsylph/libsylph-0.def +++ b/libsylph/libsylph-0.def @@ -695,3 +695,4 @@ EXPORTS folder_remote_folder_destroy_all_sessions @ 693 filter_junk_rule_create @ 694 folder_remote_folder_active_session_exist @ 695 + procmsg_add_messages_from_queue @ 696 diff --git a/libsylph/procmsg.c b/libsylph/procmsg.c index 6bff49cd..35d221af 100644 --- a/libsylph/procmsg.c +++ b/libsylph/procmsg.c @@ -1350,16 +1350,20 @@ gint procmsg_add_messages_from_queue(FolderItem *dest, GSList *mlist, dest_file = get_tmp_file(); debug_print("copy queued msg: %s -> %s\n", file, dest_file); - if (copy_file_part(fp, ftell(fp), G_MAXINT, dest_file) < 0) - is_error = TRUE; - else if (folder_item_add_msg(dest, dest_file, &flags, TRUE) < 0) { - g_unlink(dest_file); - is_error = TRUE; - } else if (is_move && folder_item_remove_msg(src, msginfo) < 0) + if (copy_file_part(fp, ftell(fp), G_MAXINT, dest_file) < 0) { + fclose(fp); is_error = TRUE; + } else { + fclose(fp); + if (folder_item_add_msg(dest, dest_file, &flags, TRUE) < 0) { + g_unlink(dest_file); + is_error = TRUE; + } else if (is_move && + folder_item_remove_msg(src, msginfo) < 0) + is_error = TRUE; + } g_free(dest_file); - fclose(fp); g_free(file); if (is_error) return -1; -- cgit v1.2.3