X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/177f020f122827214159c46dcfe7ded1e3c8d1c3..016bb7b5f141f5433d986aaa912a71b43a4cfdc2:/uip/mhpath.c diff --git a/uip/mhpath.c b/uip/mhpath.c index 2f4af3b7..3eefb112 100644 --- a/uip/mhpath.c +++ b/uip/mhpath.c @@ -6,7 +6,9 @@ */ #include +#include "h/done.h" #include +#include "sbr/m_maildir.h" #define MHPATH_SWITCHES \ X("version", 0, VERSIONSW) \ @@ -30,7 +32,7 @@ main(int argc, char **argv) struct msgs_array msgs = { 0, 0, NULL }; struct msgs *mp; - if (nmh_init(argv[0], 2)) { return 1; } + if (nmh_init(argv[0], true, false)) { return 1; } arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; @@ -45,7 +47,7 @@ main(int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", @@ -59,9 +61,8 @@ main(int argc, char **argv) } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); - else - folder = pluspath (cp); + die("only one folder at a time!"); + folder = pluspath (cp); } else app_msgarg(&msgs, cp); } @@ -84,7 +85,7 @@ main(int argc, char **argv) /* read folder and create message structure */ if (!(mp = folder_read (folder, 1))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); /* * We need to make sure there is message status space @@ -94,10 +95,10 @@ main(int argc, char **argv) */ if (mp->hghmsg >= mp->hghoff) { if (!(mp = folder_realloc (mp, 1, mp->hghmsg + 10))) - adios (NULL, "unable to allocate folder storage"); + die("unable to allocate folder storage"); } else if (mp->lowoff > 1) { if (!(mp = folder_realloc (mp, 1, mp->hghoff))) - adios (NULL, "unable to allocate folder storage"); + die("unable to allocate folder storage"); } mp->msgflags |= ALLOW_NEW; /* allow the "new" sequence */