summaryrefslogtreecommitdiffabout
path: root/kmicromail/libetpan/generic/mboxstorage.c
Unidiff
Diffstat (limited to 'kmicromail/libetpan/generic/mboxstorage.c') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libetpan/generic/mboxstorage.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kmicromail/libetpan/generic/mboxstorage.c b/kmicromail/libetpan/generic/mboxstorage.c
index 0a7dc93..4b55b2b 100644
--- a/kmicromail/libetpan/generic/mboxstorage.c
+++ b/kmicromail/libetpan/generic/mboxstorage.c
@@ -44,49 +44,49 @@
44#include <stdlib.h> 44#include <stdlib.h>
45#include <string.h> 45#include <string.h>
46 46
47/* mbox storage */ 47/* mbox storage */
48 48
49static int mbox_mailstorage_connect(struct mailstorage * storage); 49static int mbox_mailstorage_connect(struct mailstorage * storage);
50static int 50static int
51mbox_mailstorage_get_folder_session(struct mailstorage * storage, 51mbox_mailstorage_get_folder_session(struct mailstorage * storage,
52 char * pathname, mailsession ** result); 52 char * pathname, mailsession ** result);
53static void mbox_mailstorage_uninitialize(struct mailstorage * storage); 53static void mbox_mailstorage_uninitialize(struct mailstorage * storage);
54 54
55static mailstorage_driver mbox_mailstorage_driver = { 55static mailstorage_driver mbox_mailstorage_driver = {
56 .sto_name = "mbox", 56 .sto_name = "mbox",
57 .sto_connect = mbox_mailstorage_connect, 57 .sto_connect = mbox_mailstorage_connect,
58 .sto_get_folder_session = mbox_mailstorage_get_folder_session, 58 .sto_get_folder_session = mbox_mailstorage_get_folder_session,
59 .sto_uninitialize = mbox_mailstorage_uninitialize, 59 .sto_uninitialize = mbox_mailstorage_uninitialize,
60}; 60};
61 61
62int mbox_mailstorage_init(struct mailstorage * storage, 62int mbox_mailstorage_init(struct mailstorage * storage,
63 char * mbox_pathname, int mbox_cached, 63 char * mbox_pathname, int mbox_cached,
64 char * mbox_cache_directory, char * mbox_flags_directory) 64 char * mbox_cache_directory, char * mbox_flags_directory)
65{ 65{
66 struct mbox_mailstorage * mbox_storage; 66 struct mbox_mailstorage * mbox_storage;
67 67
68 mbox_storage = malloc(sizeof(struct mbox_mailstorage)); 68 mbox_storage = malloc(sizeof(* mbox_storage));
69 if (mbox_storage == NULL) 69 if (mbox_storage == NULL)
70 goto err; 70 goto err;
71 71
72 mbox_storage->mbox_pathname = strdup(mbox_pathname); 72 mbox_storage->mbox_pathname = strdup(mbox_pathname);
73 if (mbox_storage->mbox_pathname == NULL) 73 if (mbox_storage->mbox_pathname == NULL)
74 goto free; 74 goto free;
75 75
76 mbox_storage->mbox_cached = mbox_cached; 76 mbox_storage->mbox_cached = mbox_cached;
77 77
78 if (mbox_cached && (mbox_cache_directory != NULL) && 78 if (mbox_cached && (mbox_cache_directory != NULL) &&
79 (mbox_flags_directory != NULL)) { 79 (mbox_flags_directory != NULL)) {
80 mbox_storage->mbox_cache_directory = strdup(mbox_cache_directory); 80 mbox_storage->mbox_cache_directory = strdup(mbox_cache_directory);
81 if (mbox_storage->mbox_cache_directory == NULL) 81 if (mbox_storage->mbox_cache_directory == NULL)
82 goto free_pathname; 82 goto free_pathname;
83 83
84 mbox_storage->mbox_flags_directory = strdup(mbox_flags_directory); 84 mbox_storage->mbox_flags_directory = strdup(mbox_flags_directory);
85 if (mbox_storage->mbox_flags_directory == NULL) 85 if (mbox_storage->mbox_flags_directory == NULL)
86 goto free_cache_directory; 86 goto free_cache_directory;
87 } 87 }
88 else { 88 else {
89 mbox_storage->mbox_cached = FALSE; 89 mbox_storage->mbox_cached = FALSE;
90 mbox_storage->mbox_cache_directory = NULL; 90 mbox_storage->mbox_cache_directory = NULL;
91 mbox_storage->mbox_flags_directory = NULL; 91 mbox_storage->mbox_flags_directory = NULL;
92 } 92 }