if (*buffer == '#' || *buffer == '\n')
continue;
- TrimSuffixC(buffer, '\n');
+ trim_suffix_c(buffer, '\n');
/* split buffer into fields */
vecp = split (buffer, vec);
* do this - else fall through
*/
if (!next)
- continue; /* else fall */
+ continue;
+ /* FALLTHRU */
case '?':
/*
* consider delivered if action is successful.
*/
if (won)
- continue; /* else fall */
+ continue;
+ /* FALLTHRU */
case 'A':
case 'a':
if (won)
continue;
break;
- } /* else fall */
+ }
+ /* FALLTHRU */
default:
/* parse message and build lookup table */
case 'q':
/* deliver to quoted pipe */
if (strcasecmp (action, "qpipe"))
- continue; /* else fall */
+ continue;
+ /* FALLTHRU */
case '^':
expand (tmpbuf, string, fd);
if (split (tmpbuf, vec) < 1)
case 'p':
/* deliver to pipe */
if (strcasecmp (action, "pipe"))
- continue; /* else fall */
+ continue;
+ /* FALLTHRU */
case '|':
vec[2] = "sh";
vec[3] = "-c";
}
/* deliver to nmh folder */
else if (strcasecmp (action, "folder"))
- continue; /* else fall */
+ continue;
+ /* FALLTHRU */
case '+':
status = usr_folder (fd, string);
break;
}
/* mbox format */
else if (strcasecmp (action, "mbox"))
- continue; /* else fall */
+ continue;
+ /* FALLTHRU */
case '>':
/* mbox format */
switch (state = m_getfld (&gstate, name, field, &fieldsz, in)) {
case FLD:
case FLDPLUS:
- lp = add (field, NULL);
+ lp = mh_xstrdup(field);
while (state == FLDPLUS) {
fieldsz = sizeof field;
state = m_getfld (&gstate, name, field, &fieldsz, in);
pidstatus (status, stdout, ", failed");
}
return (status == 0 ? 0 : -1);
- } else {
- /*
- * Ruthlessly kill the child and anything
- * else in its process group.
- */
- killpg(child_id, SIGKILL);
- if (verbose)
- verbose_printf (", timed-out; terminated\n");
- return -1;
}
+ /*
+ * Ruthlessly kill the child and anything
+ * else in its process group.
+ */
+ killpg(child_id, SIGKILL);
+ if (verbose)
+ verbose_printf (", timed-out; terminated\n");
+ return -1;
}
}
* and massage the headers. Save
* a copy of the "From " line for later.
*/
- i = LEN("From ");
while (fgets (buffer, sizeof(buffer), qfp)) {
if (first) {
first = 0;
- if (!strncmp (buffer, "From ", i)) {
+ if (has_prefix(buffer, "From ")) {
/* get copy of envelope information ("From " line) */
envelope = mh_xstrdup(buffer);
va_list ap;
va_start(ap, fmt);
- vfprintf (stdout, fmt, ap);
+ vprintf(fmt, ap);
va_end(ap);
fflush (stdout); /* now flush output */
char *s;
eindex = errno; /* save the errno */
- fprintf (stdout, ", ");
+ printf(", ");
va_start(ap, fmt);
- vfprintf (stdout, fmt, ap);
+ vprintf(fmt, ap);
va_end(ap);
if (what) {
if (*what)
- fprintf (stdout, " %s: ", what);
+ printf(" %s: ", what);
if ((s = strerror (eindex)))
- fprintf (stdout, "%s", s);
+ fputs(s, stdout);
else
- fprintf (stdout, "Error %d", eindex);
+ printf("Error %d", eindex);
}
- fputc ('\n', stdout);
+ putchar('\n');
fflush (stdout);
}
continue;
}
- cp = add (buf, NULL);
+ cp = mh_xstrdup(buf);
while (state == FLDPLUS) {
bufsz = sizeof buf;
state = m_getfld (&gstate, name, buf, &bufsz, in);