# HG changeset patch # User Damien Riegel <damien.rie...@gmail.com> # Date 1462475374 14400 # Thu May 05 15:09:34 2016 -0400 # Node ID ec760e105fa8a6d1c7e222a68e23c86d9ba563ec # Parent 39f911aedccbfd479328252576c50073fe8d6b13 maildir: add maildir_open_mailbox function
To be more consistent with other mailboxes, introduce a function using the same template for the name (<type>_open_mailbox) and the same parameters as other mailboxes. diff -r 39f911aedccb -r ec760e105fa8 mh.c --- a/mh.c Thu May 05 14:42:15 2016 -0400 +++ b/mh.c Thu May 05 15:09:34 2016 -0400 @@ -1194,6 +1194,18 @@ return 0; } +int maildir_open_mailbox(CONTEXT *ctx) +{ + int rc = maildir_read_dir(ctx); + + if (rc) + return rc; + + ctx->mx_ops = &mx_mh_ops; + + return 0; +} + /* Read a MH/maildir style mailbox. * * args: diff -r 39f911aedccb -r ec760e105fa8 mx.c --- a/mx.c Thu May 05 14:42:15 2016 -0400 +++ b/mx.c Thu May 05 15:09:34 2016 -0400 @@ -726,7 +726,7 @@ break; case M_MAILDIR: - rc = maildir_read_dir (ctx); + rc = maildir_open_mailbox (ctx); break; case M_MMDF: diff -r 39f911aedccb -r ec760e105fa8 mx.h --- a/mx.h Thu May 05 14:42:15 2016 -0400 +++ b/mx.h Thu May 05 15:09:34 2016 -0400 @@ -59,6 +59,7 @@ int mh_check_mailbox (CONTEXT *, int *); int mh_check_empty (const char *); +int maildir_open_mailbox(CONTEXT *); int maildir_read_dir (CONTEXT *); int maildir_check_mailbox (CONTEXT *, int *); int maildir_check_empty (const char *);