X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/8a5a1a5303ddc67f06350a57a515853724a16e31..986abcee996d486db0b9c753974f3cb0eac2e9b2:/uip/show.c diff --git a/uip/show.c b/uip/show.c index 55707da4..25ede029 100644 --- a/uip/show.c +++ b/uip/show.c @@ -7,8 +7,9 @@ #include #include +#include "h/done.h" #include -#include "../sbr/m_maildir.h" +#include "sbr/m_maildir.h" #define SHOW_SWITCHES \ X("checkmime", 0, CHECKMIMESW) \ @@ -74,7 +75,7 @@ main (int argc, char **argv) struct msgs_array msgs = { 0, 0, NULL }; struct msgs_array vec = { 0, 0, NULL }, non_mhl_vec = { 0, 0, NULL }; - if (nmh_init(argv[0], 1)) { return 1; } + if (nmh_init(argv[0], true, true)) { return 1; } if (!strcasecmp (invo_name, "next")) { mode = NEXT; @@ -122,29 +123,28 @@ non_mhl_switches: case DRFTSW: if (file) - adios (NULL, "only one file at a time!"); + die("only one file at a time!"); draftsw++; if (mode == SHOW) continue; usage: - adios (NULL, - "usage: %s [+folder] [switches] [switches for showproc]", + die( "usage: %s [+folder] [switches] [switches for showproc]", invo_name); case FILESW: if (mode != SHOW) goto usage; if (draftsw || file) - adios (NULL, "only one file at a time!"); + die("only one file at a time!"); if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); file = path (cp, TFILE); continue; case FORMSW: app_msgarg(&vec, --cp); if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); - app_msgarg(&vec, getcpy (etcpath(cp))); + die("missing argument to %s", argp[-2]); + app_msgarg(&vec, mh_xstrdup(etcpath(cp))); continue; case PROGSW: @@ -159,13 +159,13 @@ usage: case WCACHESW: app_msgarg(&vec, --cp); if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); app_msgarg(&vec, cp); continue; case SHOWSW: if (!(showproc = *argp++) || *showproc == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); nshow = 0; continue; case NSHOWSW: @@ -174,7 +174,7 @@ usage: case SHOWMIMESW: if (!(showmimeproc = *argp++) || *showmimeproc == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); nshow = 0; continue; case CHECKMIMESW: @@ -187,7 +187,7 @@ usage: } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else { if (mode != SHOW) @@ -201,9 +201,9 @@ usage: if (draftsw || file) { if (msgs.size) - adios (NULL, "only one file at a time!"); + die("only one file at a time!"); if (draftsw) - app_msgarg(&vec, getcpy (m_draft (folder, NULL, 1, &isdf))); + app_msgarg(&vec, mh_xstrdup(m_draft(folder, NULL, 1, &isdf))); else app_msgarg(&vec, file); headersw = 0; @@ -233,11 +233,11 @@ usage: /* 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); /* check for empty folder */ if (mp->nummsg == 0) - adios (NULL, "no messages in %s", folder); + die("no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++)