diff options
-rw-r--r-- | camel/ChangeLog | 4 | ||||
-rw-r--r-- | camel/camel-folder.c | 4 | ||||
-rw-r--r-- | camel/providers/local/camel-mbox-store.c | 13 |
3 files changed, 19 insertions, 2 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 064105872f..cfe36ef306 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,9 @@ 2003-09-23 Jeffrey Stedfast <fejj@ximian.com> + * providers/local/camel-mbox-store.c (get_folder): If the CREATE + flag is set and the parent .sbd directory does not exist, create + it. + * camel-mime-utils.c (append_8bit): Don't forget to flush the iconv conversion. diff --git a/camel/camel-folder.c b/camel/camel-folder.c index 79b7ecaf62..034905ed2b 100644 --- a/camel/camel-folder.c +++ b/camel/camel-folder.c @@ -193,10 +193,10 @@ camel_folder_finalize (CamelObject *object) g_free(camel_folder->description); if (camel_folder->parent_store) - camel_object_unref (CAMEL_OBJECT (camel_folder->parent_store)); + camel_object_unref (camel_folder->parent_store); if (camel_folder->summary) - camel_object_unref((CamelObject *)camel_folder->summary); + camel_object_unref (camel_folder->summary); camel_folder_change_info_free(p->changed_frozen); diff --git a/camel/providers/local/camel-mbox-store.c b/camel/providers/local/camel-mbox-store.c index 0363047c6f..b0de165656 100644 --- a/camel/providers/local/camel-mbox-store.c +++ b/camel/providers/local/camel-mbox-store.c @@ -141,6 +141,7 @@ get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelExce name = mbox_folder_name_to_path (store, folder_name); if (stat (name, &st) == -1) { + char *dirname; int fd; if (errno != ENOENT) { @@ -159,6 +160,18 @@ get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelExce return NULL; } + dirname = g_path_get_dirname (name); + if (camel_mkdir (dirname, 0777) == -1 && errno != EEXIST) { + camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER, + _("Could not create directory `%s':\n%s"), + dirname, g_strerror (errno)); + g_free (dirname); + g_free (name); + return NULL; + } + + g_free (dirname); + fd = open (name, O_WRONLY | O_CREAT | O_APPEND, 0666); if (fd == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, |