-
-/*
- * slocal.c -- asynchronously filter and deliver new mail
+/* slocal.c -- asynchronously filter and deliver new mail
*
* This code is Copyright (c) 2002, by the authors of nmh. See the
* COPYRIGHT file in the root directory of the nmh distribution for
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 */
int i, state;
int fd1;
char *cp, *dp, *lp;
- char name[NAMESZ], field[BUFSIZ];
+ char name[NAMESZ], field[NMH_BUFSIZ];
struct pair *p, *q;
FILE *in;
m_getfld_state_t gstate = 0;
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);
case LENERR:
case FMTERR:
- advise (NULL, "format error in message");
+ inform("format error in message");
break;
default:
- advise (NULL, "internal error in m_getfld");
+ inform("internal error in m_getfld");
fclose (in);
return -1;
}
while (fgets (buffer, sizeof(buffer), qfp)) {
if (first) {
first = 0;
- if (HasPrefix(buffer, "From ")) {
+ if (has_prefix(buffer, "From ")) {
/* get copy of envelope information ("From " line) */
envelope = mh_xstrdup(buffer);
suppress_duplicates (int fd, char *file)
{
int fd1, lockfd, state, result;
- char *cp, buf[BUFSIZ], name[NAMESZ];
+ char *cp, buf[NMH_BUFSIZ], name[NAMESZ];
datum key, value;
DBM *db;
FILE *in;
continue;
}
- cp = add (buf, NULL);
+ cp = mh_xstrdup(buf);
while (state == FLDPLUS) {
bufsz = sizeof buf;
state = m_getfld (&gstate, name, buf, &bufsz, in);