X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/a9bb157da7d3cee576e8944eaf8fab2bdbc4be8d..63621a81d16ab743de6b57d47578a9a2c670ad22:/uip/mhstoresbr.c diff --git a/uip/mhstoresbr.c b/uip/mhstoresbr.c index d707fb8e..0e9b94cd 100644 --- a/uip/mhstoresbr.c +++ b/uip/mhstoresbr.c @@ -14,8 +14,10 @@ #include #include #include +#include "mhmisc.h" #include "mhshowsbr.h" -#include "../sbr/m_mktemp.h" +#include "sbr/m_maildir.h" +#include "sbr/m_mktemp.h" enum clobber_policy_t { NMH_CLOBBER_ALWAYS = 0, @@ -25,7 +27,7 @@ enum clobber_policy_t { NMH_CLOBBER_NEVER }; -static enum clobber_policy_t clobber_policy (const char *); +static enum clobber_policy_t clobber_policy (const char *) PURE; struct mhstoreinfo { CT *cts; /* Top-level list of contents to store. */ @@ -79,11 +81,6 @@ mhstoreinfo_files_not_clobbered (const mhstoreinfo_t info) { typedef int (*qsort_comp) (const void *, const void *); -/* mhmisc.c */ -int part_ok (CT); -int type_ok (CT, int); -void flush_errors (void); - /* * static prototypes */ @@ -530,7 +527,7 @@ store_content (CT ct, CT p, mhstoreinfo_t info) if (p) { appending = 1; if (! ct->c_storage) { - ct->c_storage = add (p->c_storage, NULL); + ct->c_storage = mh_xstrdup(FENDNULL(p->c_storage)); /* record the folder name */ if (p->c_folder) { @@ -901,13 +898,12 @@ output_content_folder (char *folder, char *filename) struct msgs *mp; /* Read the folder. */ - if ((mp = folder_read (folder, 0))) { - /* Link file into folder */ - msgnum = folder_addmsg (&mp, filename, 0, 0, 0, 0, NULL); - } else { + if (!(mp = folder_read(folder, 0))) { inform("unable to read folder %s", folder); return NOTOK; } + /* Link file into folder */ + msgnum = folder_addmsg(&mp, filename, 0, 0, 0, 0, NULL); /* free folder structure */ folder_free (mp); @@ -1074,7 +1070,7 @@ get_storeproc (CT ct) free(cp); return; } - mh_xfree(cp); + free(cp); } /* @@ -1088,7 +1084,7 @@ get_storeproc (CT ct) ct->c_storeproc = mh_xstrdup(cp); } - mh_xfree(cp); + free(cp); }