X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/55f65ae2d3baf60396d3359db952460939de03ca..975b8341cc7ff17cbe4a5900b6ed41c47cceed62:/uip/mhshow.c diff --git a/uip/mhshow.c b/uip/mhshow.c index f289d471..eb6ea16b 100644 --- a/uip/mhshow.c +++ b/uip/mhshow.c @@ -31,6 +31,8 @@ X("form formfile", 0, FORMSW) \ X("part number", 0, PARTSW) \ X("type content", 0, TYPESW) \ + X("textcharset", 0, TEXTCHARSETSW) \ + X("notextcharset", 0, NTEXTCHARSETSW) \ X("rcache policy", 0, RCACHESW) \ X("wcache policy", 0, WCACHESW) \ X("version", 0, VERSIONSW) \ @@ -56,9 +58,6 @@ DEFINE_SWITCH_ARRAY(MHSHOW, switches); #undef X -/* mhparse.c */ -extern char *tmp; /* directory to place temp files */ - /* mhcachesbr.c */ extern int rcachesw; extern int wcachesw; @@ -69,7 +68,7 @@ extern char *cache_private; extern int pausesw; extern int serialsw; extern char *progsw; -extern int nolist; +extern char *display_charset; extern int nomore; /* flags for moreproc/header display */ extern char *formsw; @@ -118,15 +117,9 @@ main (int argc, char **argv) CT ct, *ctp; FILE *fp; - done=freects_done; - -#ifdef LOCALE - setlocale(LC_ALL, ""); -#endif - invo_name = r1bindex (argv[0], '/'); + if (nmh_init(argv[0], 1)) { return 1; } - /* read user profile/context */ - context_read(); + done=freects_done; arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; @@ -210,6 +203,16 @@ do_cache: types[ntype++] = cp; continue; + case TEXTCHARSETSW: + if (!(cp = *argp++) || *cp == '-') + adios (NULL, "missing argument to %s", argp[-2]); + display_charset = cp; + continue; + + case NTEXTCHARSETSW: + display_charset = NULL; + continue; + case FILESW: if (!(cp = *argp++) || (*cp == '-' && cp[1])) adios (NULL, "missing argument to %s", argp[-2]); @@ -294,16 +297,6 @@ do_cache: cache_private = ".cache"; cache_private = getcpy (m_maildir (cache_private)); - /* - * Check for storage directory. If specified, - * then store temporary files there. Else we - * store them in standard nmh directory. - */ - if ((cp = context_find (nmhstorage)) && *cp) - tmp = concat (cp, "/", invo_name, NULL); - else - tmp = add (m_maildir (invo_name), NULL); - if (!context_find ("path")) free (path ("./", TFOLDER));