From f6e7f36409b5b0ac0edbf4709bcd093e5b6e9f8b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ho=C3=A0=20Vi=C3=AAt=20Dinh?= Date: Fri, 18 May 2001 03:52:24 +0000 Subject: [PATCH] better handling of missing directories --- src/compose.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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 { -- 2.25.1