X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/0509728c8a506f287fa3483d8e8ffaf8fb66d41d..6547ca9f73c3f02b2356017bbd7ff85292f8e4a1:/uip/mhn.c diff --git a/uip/mhn.c b/uip/mhn.c index 6a1acc38..a5b4a274 100644 --- a/uip/mhn.c +++ b/uip/mhn.c @@ -15,8 +15,10 @@ #include #include #include +#include "h/done.h" #include -#include "../sbr/m_maildir.h" +#include "mhmisc.h" +#include "sbr/m_maildir.h" #include "mhfree.h" #include "mhshowsbr.h" @@ -75,13 +77,6 @@ DEFINE_SWITCH_ARRAY(MHN, switches); #undef X -/* mhmisc.c */ -extern int npart; -extern int ntype; -extern char *parts[NPARTS + 1]; -extern char *types[NTYPES + 1]; -extern int userrs; - int debugsw = 0; int verbosw = 0; @@ -101,14 +96,6 @@ static int storesw = 0; #define quitser pipeser -/* mhparse.c */ -CT parse_mime (char *); - -/* mhmisc.c */ -int part_ok (CT); -int type_ok (CT, int); -void flush_errors (void); - /* * static prototypes */ @@ -132,7 +119,7 @@ main (int argc, char **argv) if (nmh_init(argv[0], 1)) { return 1; } - done=freects_done; + set_done(freects_done); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; @@ -260,8 +247,8 @@ do_cache: case FORMSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); - mh_xfree(formsw); - formsw = getcpy (etcpath (cp)); + free(formsw); + formsw = mh_xstrdup(etcpath(cp)); continue; /* @@ -311,8 +298,7 @@ do_cache: if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); - else - folder = pluspath (cp); + folder = pluspath (cp); } else app_msgarg(&msgs, cp); } @@ -326,7 +312,7 @@ do_cache: */ if ((cp = getenv ("MHN"))) { if ((fp = fopen (cp, "r"))) { - readconfig ((struct node **) 0, fp, cp, 0); + readconfig(NULL, fp, cp, 0); fclose (fp); } else { admonish ("", "unable to read $MHN profile (%s)", cp); @@ -337,7 +323,7 @@ do_cache: * Read the standard profile setup */ if ((fp = fopen (cp = etcpath ("mhn.defaults"), "r"))) { - readconfig ((struct node **) 0, fp, cp, 0); + readconfig(NULL, fp, cp, 0); fclose (fp); } @@ -348,7 +334,7 @@ do_cache: /* Check for private cache location */ if (!(cache_private = context_find (nmhprivcache))) cache_private = ".cache"; - cache_private = getcpy (m_maildir (cache_private)); + cache_private = mh_xstrdup(m_maildir(cache_private)); /* * Cache the current directory before we do any chdirs()'s. @@ -385,7 +371,7 @@ do_cache: execvp ("mhbuild", vec); fprintf (stderr, "unable to exec "); - _exit (-1); + _exit(1); } /* @@ -412,7 +398,7 @@ do_cache: execvp ("mhbuild", vec); fprintf (stderr, "unable to exec "); - _exit (-1); + _exit(1); } if (file && msgs.size)