Diffstat (limited to 'kmicromail/libetpan/generic/maildirstorage.c') (more/less context) (show whitespace changes)
-rw-r--r-- | kmicromail/libetpan/generic/maildirstorage.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kmicromail/libetpan/generic/maildirstorage.c b/kmicromail/libetpan/generic/maildirstorage.c index 7e6b461..e37f591 100644 --- a/kmicromail/libetpan/generic/maildirstorage.c +++ b/kmicromail/libetpan/generic/maildirstorage.c | |||
@@ -24,24 +24,25 @@ | |||
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
29 | * SUCH DAMAGE. | 29 | * SUCH DAMAGE. |
30 | */ | 30 | */ |
31 | 31 | ||
32 | /* | 32 | /* |
33 | * $Id$ | 33 | * $Id$ |
34 | */ | 34 | */ |
35 | 35 | ||
36 | #include "maildirstorage.h" | ||
36 | #include "mailstorage.h" | 37 | #include "mailstorage.h" |
37 | 38 | ||
38 | #include "mail.h" | 39 | #include "mail.h" |
39 | #include "mailmessage.h" | 40 | #include "mailmessage.h" |
40 | #include "maildirdriver.h" | 41 | #include "maildirdriver.h" |
41 | #include "maildirdriver_cached.h" | 42 | #include "maildirdriver_cached.h" |
42 | #include "maildriver.h" | 43 | #include "maildriver.h" |
43 | 44 | ||
44 | #include <stdlib.h> | 45 | #include <stdlib.h> |
45 | #include <string.h> | 46 | #include <string.h> |
46 | 47 | ||
47 | /* maildir storage */ | 48 | /* maildir storage */ |
@@ -56,25 +57,25 @@ static mailstorage_driver maildir_mailstorage_driver = { | |||
56 | .sto_name = "maildir", | 57 | .sto_name = "maildir", |
57 | .sto_connect = maildir_mailstorage_connect, | 58 | .sto_connect = maildir_mailstorage_connect, |
58 | .sto_get_folder_session = maildir_mailstorage_get_folder_session, | 59 | .sto_get_folder_session = maildir_mailstorage_get_folder_session, |
59 | .sto_uninitialize = maildir_mailstorage_uninitialize, | 60 | .sto_uninitialize = maildir_mailstorage_uninitialize, |
60 | }; | 61 | }; |
61 | 62 | ||
62 | int maildir_mailstorage_init(struct mailstorage * storage, | 63 | int maildir_mailstorage_init(struct mailstorage * storage, |
63 | char * md_pathname, int md_cached, | 64 | char * md_pathname, int md_cached, |
64 | char * md_cache_directory, char * md_flags_directory) | 65 | char * md_cache_directory, char * md_flags_directory) |
65 | { | 66 | { |
66 | struct maildir_mailstorage * maildir_storage; | 67 | struct maildir_mailstorage * maildir_storage; |
67 | 68 | ||
68 | maildir_storage = malloc(sizeof(struct maildir_mailstorage)); | 69 | maildir_storage = malloc(sizeof(* maildir_storage)); |
69 | if (maildir_storage == NULL) | 70 | if (maildir_storage == NULL) |
70 | goto err; | 71 | goto err; |
71 | 72 | ||
72 | maildir_storage->md_pathname = strdup(md_pathname); | 73 | maildir_storage->md_pathname = strdup(md_pathname); |
73 | if (maildir_storage->md_pathname == NULL) | 74 | if (maildir_storage->md_pathname == NULL) |
74 | goto free; | 75 | goto free; |
75 | 76 | ||
76 | maildir_storage->md_cached = md_cached; | 77 | maildir_storage->md_cached = md_cached; |
77 | 78 | ||
78 | if (md_cached && (md_cache_directory != NULL) && | 79 | if (md_cached && (md_cache_directory != NULL) && |
79 | (md_flags_directory != NULL)) { | 80 | (md_flags_directory != NULL)) { |
80 | maildir_storage->md_cache_directory = strdup(md_cache_directory); | 81 | maildir_storage->md_cache_directory = strdup(md_cache_directory); |