From: Hoà Viêt Dinh Date: Fri, 18 May 2001 03:52:24 +0000 (+0000) Subject: better handling of missing directories X-Git-Tag: VERSION_0_5_0~148 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=f6e7f36409b5b0ac0edbf4709bcd093e5b6e9f8b;hp=ae706ee0f7354bacac74c77f00862ddf3dc00a7a better handling of missing directories --- diff --git a/src/compose.c b/src/compose.c index c2c91ecd3..fe5ed023b 100644 --- a/src/compose.c +++ b/src/compose.c @@ -1674,16 +1674,17 @@ static gint compose_save_to_outbox(Compose *compose, const gchar *file) debug_print(_("saving sent message...\n")); outbox = folder_get_default_outbox(); + path = folder_item_get_path(outbox); + if (!is_dir_exist(path)) + make_dir_hier(path); + folder_item_scan(outbox); if ((num = folder_item_add_msg(outbox, file, FALSE)) < 0) { + g_free(path); g_warning(_("can't save message\n")); return -1; } - path = folder_item_get_path(outbox); - if (!is_dir_exist(path)) - make_dir_hier(path); - if ((fp = procmsg_open_mark_file(path, TRUE)) == NULL) g_warning(_("can't open mark file\n")); else { @@ -1782,18 +1783,18 @@ static gint compose_queue(Compose *compose, const gchar *file) queue = folder_get_default_queue(); folder_item_scan(queue); + queue_path = folder_item_get_path(queue); + if (!is_dir_exist(queue_path)) + make_dir_hier(queue_path); if ((num = folder_item_add_msg(queue, tmp, TRUE)) < 0) { g_warning(_("can't queue the message\n")); unlink(tmp); g_free(tmp); + g_free(queue_path); return -1; } g_free(tmp); - queue_path = folder_item_get_path(queue); - if (!is_dir_exist(queue_path)) - make_dir_hier(queue_path); - if ((fp = procmsg_open_mark_file(queue_path, TRUE)) == NULL) g_warning(_("can't open mark file\n")); else {