-
-/*
- * mhlsbr.c -- main routines for nmh message lister
+/* mhlsbr.c -- main routines for nmh message lister
*
* This code is Copyright (c) 2002, by the authors of nmh. See the
* COPYRIGHT file in the root directory of the nmh distribution for
#include <h/fmt_scan.h>
#include <h/tws.h>
#include <h/utils.h>
+#include "../sbr/m_popen.h"
#include <setjmp.h>
#include <sys/types.h>
* set, then addresses get split wrong (not at the spaces between commas).
* To fix this correctly, putstr() should know about "atomic" strings that
* must NOT be broken across lines. That's too difficult for right now
- * (it turns out that there are a number of degernate cases), so in
+ * (it turns out that there are a number of degenerate cases), so in
* oneline(), instead of
*
* (*onelp == '\n' && !onelp[1])
"\n----------------------------------------------------------------------\n\n";
static char delim4[] = "\n------------------------------\n\n";
-static FILE *(*mhl_action) () = (FILE *(*) ()) 0;
+static FILE *(*mhl_action)(char *);
/*
* prototypes
continue;
case BITSTUFFSW:
- dashstuff = 1; /* trinary logic */
+ dashstuff = 1; /* ternary logic */
continue;
case NBITSTUFFSW:
- dashstuff = -1; /* trinary logic */
+ dashstuff = -1; /* ternary logic */
continue;
case NBODYSW:
}
else
printf ("\n------- End of Forwarded Message%s\n",
- vecp > 1 ? "s" : "");
+ PLURALS(vecp));
}
fflush(stdout);
for (cp = result; *parptr && (cp - result < NAMESZ); parptr++) {
c = *parptr;
- if (isalnum (c)
- || c == '.'
- || c == '-'
- || c == '_'
- || c =='['
- || c == ']')
- *cp++ = c;
- else
+ if (!isalnum (c)
+ && c != '.'
+ && c != '-'
+ && c != '_'
+ && c !='['
+ && c != ']')
break;
+ *cp++ = c;
}
*cp = '\0';
{
int state, bucket;
struct mcomp *c1, *c2, *c3;
- char **ip, name[NAMESZ], buf[BUFSIZ];
+ char **ip, name[NAMESZ], buf[NMH_BUFSIZ];
m_getfld_state_t gstate = 0;
compile_filterargs();
else {
printf ("\n-------");
if (ofilen == 1)
- printf (" Forwarded Message%s", ofilec > 1 ? "s" : "");
+ printf (" Forwarded Message%s", PLURALS(ofilec));
else
printf (" Message %d", ofilen);
printf ("\n\n");
continue;
for (c2 = fmthd; c2; c2 = c2->c_next)
- if (!strcasecmp (c2->c_name ? c2->c_name : "", name))
+ if (!strcasecmp (FENDNULL(c2->c_name), name))
break;
c1 = NULL;
if (!((c3 = c2 ? c2 : &global)->c_flags & SPLIT))
for (c1 = msghd; c1; c1 = c1->c_next)
- if (!strcasecmp (c1->c_name ? c1->c_name : "",
- c3->c_name ? c3->c_name : "")) {
+ if (!strcasecmp (FENDNULL(c1->c_name),
+ FENDNULL(c3->c_name))) {
c1->c_text =
mcomp_add (c1->c_flags, buf, c1->c_text);
break;
continue;
}
for (c2 = msghd; c2; c2 = c2->c_next)
- if (!strcasecmp (c2->c_name ? c2->c_name : "",
- c1->c_name ? c1->c_name : "")) {
+ if (!strcasecmp (FENDNULL(c2->c_name),
+ FENDNULL(c1->c_name))) {
putcomp (c1, c2, ONECOMP);
if (!(c1->c_flags & SPLIT))
break;
*onelp++ = 0;
break;
}
- else
- if (!spc) {
- *cp++ = ' ';
- spc++;
- }
+ if (!spc) {
+ *cp++ = ' ';
+ spc++;
+ }
}
else {
*cp++ = *onelp;
putch ('\n', flags);
if (ovoff > 0)
lm = ovoff;
- putstr (ovtxt ? ovtxt : "", flags);
+ putstr (FENDNULL(ovtxt), flags);
putch (ch, flags);
return;
}