X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/dc4d0c4bf247cfc88e1f3f9463fa2264d3d226b5..ef0725fd97369e801a56febfdb7a6ec2eaff73c8:/uip/mhshowsbr.c diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index 2a754a41..9cd67331 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -5,17 +5,25 @@ * complete copyright information. */ -#include +#include "h/mh.h" +#include "sbr/fmt_new.h" +#include "sbr/concat.h" +#include "sbr/trimcpy.h" +#include "sbr/check_charset.h" +#include "sbr/getcpy.h" +#include "sbr/context_find.h" +#include "sbr/pidstatus.h" +#include "sbr/arglist.h" +#include "sbr/error.h" #include -#include -#include -#include -#include -#include -#include -#include +#include "h/signals.h" +#include "h/mts.h" +#include "h/tws.h" +#include "h/mime.h" +#include "h/mhparse.h" +#include "h/fmt_scan.h" #include "h/done.h" -#include +#include "h/utils.h" #include "mhmisc.h" #include "mhshowsbr.h" #include "sbr/m_mktemp.h" @@ -25,8 +33,6 @@ extern int debugsw; -int nolist = 0; - char *progsw = NULL; /* flags for moreproc/header display */ @@ -94,7 +100,6 @@ void show_all_messages(CT *cts, int concat, int textonly, int inlineonly) { CT ct, *ctp; - struct format *hfmt, *mfmt; /* * If form is not specified, then get default form @@ -103,12 +108,6 @@ show_all_messages(CT *cts, int concat, int textonly, int inlineonly) if (!formsw) formsw = mh_xstrdup(etcpath("mhl.headers")); - /* - * Compile the content marker and header format lines - */ - mfmt = compile_marker(markerform); - hfmt = compile_header(headerform); - /* * If form is "mhl.null", suppress display of header. */ @@ -120,16 +119,30 @@ show_all_messages(CT *cts, int concat, int textonly, int inlineonly) /* if top-level type is ok, then display message */ if (type_ok (ct, 1)) { - if (headersw) output_header(ct, hfmt); + /* + * Compile the content marker format line + */ + struct format *mfmt = compile_marker(markerform); + + if (headersw) { + /* + * Compile the header format line + */ + struct format *hfmt = compile_header(headerform); + output_header(ct, hfmt); + fmt_free(hfmt, 0); + } show_single_message (ct, formsw, concat, textonly, inlineonly, mfmt); + fmt_free(mfmt, 0); } } + /* Reset the format component hashtable, which free's any components which + it references. */ + fmt_free(NULL, 1); free_markercomps(); - fmt_free(hfmt, 1); - fmt_free(mfmt, 1); } @@ -461,7 +474,6 @@ show_content_aux2 (CT ct, int alternate, char *cracked, char *buffer, } vec = argsplit(buffer, &file, &vecp); - vec[vecp++] = NULL; fflush (stdout); @@ -898,7 +910,7 @@ parse_display_string (CT ct, char *cp, int *xstdin, int *xlist, case 'l': /* display listing prior to displaying content */ - *xlist = !nolist; + *xlist = 1; break; case 's': @@ -1307,7 +1319,7 @@ compile_header(char *form) fmtstring = new_fs(form, NULL, DEFAULT_HEADER); - (void) fmt_compile(fmtstring, &fmt, 1); + (void) fmt_compile(fmtstring, &fmt, 0); free_fs(); while ((comp = fmt_nextcomp(comp, &bucket)) != NULL) { @@ -1330,7 +1342,7 @@ compile_marker(char *form) fmtstring = new_fs(form, NULL, DEFAULT_MARKER); - (void) fmt_compile(fmtstring, &fmt, 1); + (void) fmt_compile(fmtstring, &fmt, 0); free_fs(); /*