X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/0509728c8a506f287fa3483d8e8ffaf8fb66d41d..04ee0c3f6ad7e4177cc43a0c57f046013a4fbac9:/uip/mhpath.c diff --git a/uip/mhpath.c b/uip/mhpath.c index 16425ac1..95a9d755 100644 --- a/uip/mhpath.c +++ b/uip/mhpath.c @@ -5,9 +5,14 @@ * complete copyright information. */ -#include -#include -#include "../sbr/m_maildir.h" +#include "h/mh.h" +#include "sbr/path.h" +#include "sbr/print_version.h" +#include "sbr/print_help.h" +#include "sbr/error.h" +#include "h/done.h" +#include "h/utils.h" +#include "sbr/m_maildir.h" #define MHPATH_SWITCHES \ X("version", 0, VERSIONSW) \ @@ -31,7 +36,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; @@ -46,7 +51,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]", @@ -60,9 +65,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); } @@ -85,7 +89,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 @@ -95,10 +99,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 */