X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/10c5b65eb8fefdf84cdb631edcd18160effcdf7e..5977791e005446f4cd8b2f04bfb14c8cd265df8a:/uip/mhstoresbr.c diff --git a/uip/mhstoresbr.c b/uip/mhstoresbr.c index a651d01a..46574a13 100644 --- a/uip/mhstoresbr.c +++ b/uip/mhstoresbr.c @@ -10,9 +10,14 @@ #include #include #include +#include #include #include #include +#include "mhmisc.h" +#include "mhshowsbr.h" +#include "../sbr/m_maildir.h" +#include "../sbr/m_mktemp.h" enum clobber_policy_t { NMH_CLOBBER_ALWAYS = 0, @@ -22,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. */ @@ -76,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 */ @@ -527,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) { @@ -947,7 +947,9 @@ parse_format_string (CT ct, char *cp, char *buffer, int buflen, char *dir) * appropriate directory. */ if (*cp != '/' && *cp != '|' && *cp != '!') { - snprintf (bp, buflen, "%s/", dir[1] ? dir : ""); + if (!strcmp(dir, "/")) + dir = ""; /* Don't start with "//". */ + snprintf (bp, buflen, "%s/", dir); len = strlen (bp); bp += len; buflen -= len;