-
-/*
- * fmt_compile.c -- "compile" format strings for fmt_scan
+/* fmt_compile.c -- "compile" format strings for fmt_scan
*
* This code is Copyright (c) 2002, by the authors of nmh. See the
* COPYRIGHT file in the root directory of the nmh distribution for
int i, errpos, errctx;
errpos = cp - format_string;
- errctx = errpos > 20 ? 20 : errpos;
+ errctx = min(errpos, 20);
usr_fstring[errpos] = '\0';
for (i = errpos-errctx; i < errpos; i++) {
*
* Okay, got some more information on this from John L. Romine! From an
* email he sent to the nmh-workers mailing list on December 2, 2010, he
- * explains it thusly:
+ * explains it so:
*
* In this case (scan, formatsbr) it has to do with an extension to
* the mh-format syntax to allow for looping.
struct comp *cm;
for (cm = wantcomp[CHASH(component)]; cm; cm = cm->c_next)
- if (strcasecmp(component, cm->c_name ? cm->c_name : "") == 0)
+ if (strcasecmp(component, FENDNULL(cm->c_name)) == 0)
break;
return cm;
char *cp;
while (cptr) {
- if (strcasecmp(component, cptr->c_name ? cptr->c_name : "") == 0) {
+ if (strcasecmp(component, FENDNULL(cptr->c_name)) == 0) {
found++;
if (! cptr->c_text) {
cptr->c_text = getcpy(text);
if (bucket != -1) {
for (cptr = wantcomp[bucket]; cptr; cptr = cptr->c_next)
- if (strcasecmp(component, cptr->c_name ? cptr->c_name : "") == 0)
+ if (strcasecmp(component, FENDNULL(cptr->c_name)) == 0)
cptr->c_text = add(text, cptr->c_text);
}
}