#include <h/md5.h>
#include <h/mts.h>
#include <h/tws.h>
+#include <h/fmt_scan.h>
#include <h/mime.h>
#include <h/mhparse.h>
#include <h/utils.h>
+#include "mhmisc.h"
+#include "mhshowsbr.h"
+#include "sbr/m_maildir.h"
+#include "sbr/m_mktemp.h"
enum clobber_policy_t {
NMH_CLOBBER_ALWAYS = 0,
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. */
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
*/
struct partial *am = (struct partial *) ((*a)->c_ctparams);
struct partial *bm = (struct partial *) ((*b)->c_ctparams);
- return (am->pm_marked - bm->pm_marked);
+ return am->pm_marked - bm->pm_marked;
}
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) {
fclose (fp);
- return (cc != NOTOK ? OK : NOTOK);
+ return cc == NOTOK ? NOTOK : OK;
}
if (!ct->c_fp && (ct->c_fp = fopen (ct->c_file, "r")) == NULL) {
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);
* 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;
free(cp);
return;
}
- mh_xfree(cp);
+ free(cp);
}
/*
ct->c_storeproc = mh_xstrdup(cp);
}
- mh_xfree(cp);
+ free(cp);
}