summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d4aff07)
Knowing the domain of the variable is Boolean aids comprehension of the
variable's name and purpose.
22 files changed:
int
main (int argc, char **argv)
{
int
main (int argc, char **argv)
{
- int msgnum, *icachesw, autosw = 0;
+ int msgnum, *icachesw;
+ bool autosw = false;
/* verbosw defaults to 1 for backward compatibility. */
bool verbosw = true;
const char *clobbersw = "always";
/* verbosw defaults to 1 for backward compatibility. */
bool verbosw = true;
const char *clobbersw = "always";
int
main (int argc, char **argv)
{
int
main (int argc, char **argv)
{
- int datesw = 1, notifysw = NT_ALL;
- int status = 0, sasl = 0, tls = 0, noverify = 0;
- int snoop = 0, vecp = 0;
+ bool datesw = true;
+ int notifysw = NT_ALL;
+ int status = 0;
+ bool sasl = false;
+ bool tls = false;
+ bool noverify = false;
+ bool snoop = false;
+ int vecp = 0;
char *cp, *host = NULL, *port = NULL, *user = NULL, *proxy = NULL;
char buf[BUFSIZ], *saslmech = NULL, *auth_svc = NULL;
char **argp, **arguments, *vec[MAXVEC];
char *cp, *host = NULL, *port = NULL, *user = NULL, *proxy = NULL;
char buf[BUFSIZ], *saslmech = NULL, *auth_svc = NULL;
char **argp, **arguments, *vec[MAXVEC];
continue;
case SASLMECHSW:
continue;
case SASLMECHSW:
continue;
case INITTLSSW:
continue;
case INITTLSSW:
continue;
case CERTVERSW:
continue;
case CERTVERSW:
continue;
case NOCERTVERSW:
continue;
case NOCERTVERSW:
continue;
case AUTHSERVICESW:
continue;
case AUTHSERVICESW:
int
main (int argc, char **argv)
{
int
main (int argc, char **argv)
{
- int publicsw = -1, zerosw = 1, vecp = 0;
+ int publicsw = -1;
+ bool zerosw = true;
+ int vecp = 0;
size_t seqp = 0;
int msgnum;
char *maildir, *folder = NULL, buf[100];
size_t seqp = 0;
int msgnum;
char *maildir, *folder = NULL, buf[100];
publicsw = 0;
continue;
case ZEROSW:
publicsw = 0;
continue;
case ZEROSW:
static int
GREPaction(struct nexus *n, FILE *fp, int msgnum, long start, long stop)
{
static int
GREPaction(struct nexus *n, FILE *fp, int msgnum, long start, long stop)
{
+ int c;
+ bool body;
+ bool lf;
long pos = start;
char *p1, *p2, *ebp, *cbp;
char ibuf[BUFSIZ];
NMH_UNUSED (msgnum);
fseek (fp, start, SEEK_SET);
long pos = start;
char *p1, *p2, *ebp, *cbp;
char ibuf[BUFSIZ];
NMH_UNUSED (msgnum);
fseek (fp, start, SEEK_SET);
ebp = cbp = ibuf;
for (;;) {
if (body && n->n_header)
return 0;
p1 = linebuf;
p2 = cbp;
ebp = cbp = ibuf;
for (;;) {
if (body && n->n_header)
return 0;
p1 = linebuf;
p2 = cbp;
for (;;) {
if (p2 >= ebp) {
if (fgets (ibuf, sizeof ibuf, fp) == NULL
for (;;) {
if (p2 >= ebp) {
if (fgets (ibuf, sizeof ibuf, fp) == NULL
}
if (c == '\n') {
if (body)
break;
if (lf) {
}
if (c == '\n') {
if (body)
break;
if (lf) {
/* Unfold by skipping the newline. */
c = 0;
}
/* Unfold by skipping the newline. */
c = 0;
}
/* Attempt to decode as a MIME header. If it's the last header,
body will be 1 and lf will be at least 1. */
/* Attempt to decode as a MIME header. If it's the last header,
body will be 1 and lf will be at least 1. */
- if ((body == 0 || lf > 0) &&
decode_rfc2047 (linebuf, decoded_linebuf, sizeof decoded_linebuf)) {
p1 = decoded_linebuf;
}
decode_rfc2047 (linebuf, decoded_linebuf, sizeof decoded_linebuf)) {
p1 = decoded_linebuf;
}
static int
check_mech(char *server_mechs, size_t server_mechs_size)
{
static int
check_mech(char *server_mechs, size_t server_mechs_size)
{
- int status, sasl_capability = 0;
+ int status;
+ bool sasl_capability = false;
/*
* First off, we're going to send the CAPA command to see if we can
/*
* First off, we're going to send the CAPA command to see if we can
if (strncasecmp(response, "SASL ", 5) == 0) {
/* We've seen the SASL capability. Grab the mech list. */
if (strncasecmp(response, "SASL ", 5) == 0) {
/* We've seen the SASL capability. Grab the mech list. */
+ sasl_capability = true;
strncpy(server_mechs, response + 5, server_mechs_size);
}
}
strncpy(server_mechs, response + 5, server_mechs_size);
}
}
static short outputlinelen = OUTPUTLINELEN;
static int pfd = NOTOK; /* fd to write annotation list to */
static short outputlinelen = OUTPUTLINELEN;
static int pfd = NOTOK; /* fd to write annotation list to */
-static int recipients = 0; /* how many people will get a copy */
+static bool recipients; /* how many people will get a copy */
static int unkadr = 0; /* how many of those were unknown */
static int badadr = 0; /* number of bad addrs */
static int unkadr = 0; /* how many of those were unknown */
static int badadr = 0; /* number of bad addrs */
-static int badmsg = 0; /* message has bad semantics */
-static int verbose = 0; /* spell it out */
+static bool badmsg; /* message has bad semantics */
+static bool verbose; /* spell it out */
static bool format = true; /* format addresses */
static bool format = true; /* format addresses */
-static int mime = 0; /* use MIME-style encapsulations for Bcc */
-static int msgid = 0; /* add msgid */
-static int debug = 0; /* debugging post */
-static int watch = 0; /* watch the delivery process */
-static int whomsw = 0; /* we are whom not post */
-static int checksw = 0; /* whom -check */
+static bool mime; /* use MIME-style encapsulations for Bcc */
+static bool msgid; /* add msgid */
+static bool debug; /* debugging post */
+static bool watch; /* watch the delivery process */
+static bool whomsw; /* we are whom not post */
+static bool checksw; /* whom -check */
static int linepos=0; /* putadr()'s position on the line */
static int nameoutput=0; /* putadr() has output header name */
static int linepos=0; /* putadr()'s position on the line */
static int nameoutput=0; /* putadr() has output header name */
-static int sasl=0; /* Use SASL auth for SMTP */
+static bool sasl; /* Use SASL auth for SMTP */
static char *saslmech=NULL; /* Force use of particular SASL mech */
static char *user=NULL; /* Authenticate as this user */
static char *port="submission"; /* Name of server port for SMTP submission */
static int tlsflag=0; /* Flags to control TLS settings */
static int fromcount=0; /* Count of addresses on From: header */
static char *saslmech=NULL; /* Force use of particular SASL mech */
static char *user=NULL; /* Authenticate as this user */
static char *port="submission"; /* Name of server port for SMTP submission */
static int tlsflag=0; /* Flags to control TLS settings */
static int fromcount=0; /* Count of addresses on From: header */
-static int seensender=0; /* Have we seen a Sender: header? */
+static bool seensender; /* Have we seen a Sender: header? */
static unsigned msgflags = 0; /* what we've seen */
static unsigned msgflags = 0; /* what we've seen */
static struct mailname uuaddrs; /* uucp addrs */
static struct mailname tmpaddrs; /* temporary queue */
static struct mailname uuaddrs; /* uucp addrs */
static struct mailname tmpaddrs; /* temporary queue */
static char *clientsw = NULL;
static char *serversw = NULL;
static char *clientsw = NULL;
static char *serversw = NULL;
int
main (int argc, char **argv)
{
int
main (int argc, char **argv)
{
- int state, compnum, dashstuff = 0, swnum, oauth_flag = 0, tls = -1;
- int noverify = 0;
+ int state, compnum, dashstuff = 0, swnum;
+ bool oauth_flag = false;
+ int tls = -1;
+ bool noverify = false;
int eai = 0; /* use Email Address Internationalization (EAI) (SMTPUTF8) */
char *cp, *msg = NULL, **argp, **arguments, *envelope;
char buf[NMH_BUFSIZ], name[NAMESZ], *auth_svc = NULL;
int eai = 0; /* use Email Address Internationalization (EAI) (SMTPUTF8) */
char *cp, *msg = NULL, **argp, **arguments, *envelope;
char buf[NMH_BUFSIZ], name[NAMESZ], *auth_svc = NULL;
case FILTSW:
if (!(filter = *argp++) || *filter == '-')
die("missing argument to %s", argp[-2]);
case FILTSW:
if (!(filter = *argp++) || *filter == '-')
die("missing argument to %s", argp[-2]);
continue;
case NFILTSW:
filter = NULL;
continue;
case NFILTSW:
filter = NULL;
filter = NULL;
continue;
case NMIMESW:
filter = NULL;
continue;
case NMIMESW:
die("missing argument to %s", argp[-2]);
continue;
case SNOOPSW:
die("missing argument to %s", argp[-2]);
continue;
case SNOOPSW:
continue;
case SASLMECHSW:
continue;
case SASLMECHSW:
case AUTHSERVICESW:
if (!(auth_svc = *argp++) || *auth_svc == '-')
die("missing argument to %s", argp[-2]);
case AUTHSERVICESW:
if (!(auth_svc = *argp++) || *auth_svc == '-')
die("missing argument to %s", argp[-2]);
continue;
case OAUTHCREDFILESW:
continue;
case OAUTHCREDFILESW:
die("internal error: cannot map switch %s "
"to profile entry", argp[-2]);
die("internal error: cannot map switch %s "
"to profile entry", argp[-2]);
continue;
case CERTVERSW:
continue;
case CERTVERSW:
continue;
case NOCERTVERSW:
continue;
case NOCERTVERSW:
continue;
case FILEPROCSW:
continue;
case FILEPROCSW:
start_headers ();
if (debug) {
start_headers ();
if (debug) {
out = stdout;
} else {
if (whomsw) {
out = stdout;
} else {
if (whomsw) {
static void
putfmt (char *name, char *str, int *eai, FILE *out)
{
static void
putfmt (char *name, char *str, int *eai, FILE *out)
{
- int count, grp, i, keep;
+ int count;
+ bool grp;
+ int i, keep;
char *cp, *pp, *qp;
char namep[BUFSIZ], error[BUFSIZ];
char *savehdr = NULL;
char *cp, *pp, *qp;
char namep[BUFSIZ], error[BUFSIZ];
char *savehdr = NULL;
if (msgstate == NORMAL && uprf (name, "resent")) {
inform("illegal header line -- %s:", name);
if (msgstate == NORMAL && uprf (name, "resent")) {
inform("illegal header line -- %s:", name);
}
if (hdr->flags & HBAD) {
inform("illegal header line -- %s:", name);
}
if (hdr->flags & HBAD) {
inform("illegal header line -- %s:", name);
return;
}
msgflags |= (hdr->set & ~(MVIS | MINV));
return;
}
msgflags |= (hdr->set & ~(MVIS | MINV));
if (hdr->flags & HTRY)
badadr++;
else
if (hdr->flags & HTRY)
badadr++;
else
if ((msgstate == RESENT) ? (hdr->set & MRSN)
: (hdr->set & MSND)) {
inform("%s: field requires one address", name);
if ((msgstate == RESENT) ? (hdr->set & MRSN)
: (hdr->set & MSND)) {
inform("%s: field requires one address", name);
}
#ifdef notdef
inform("%s: field requires at least one address", name);
}
#ifdef notdef
inform("%s: field requires at least one address", name);
#endif /* notdef */
}
return;
#endif /* notdef */
}
return;
if (count > 1 && (hdr->flags & HONE)) {
inform("%s: field only permits one address", name);
if (count > 1 && (hdr->flags & HONE)) {
inform("%s: field only permits one address", name);
snprintf (namep, sizeof(namep), "%s%s",
(hdr->flags & HMNG) ? "Original-" : "", name);
snprintf (namep, sizeof(namep), "%s%s",
(hdr->flags & HMNG) ? "Original-" : "", name);
- for (grp = 0, mp = tmpaddrs.m_next; mp; mp = np)
+ for (grp = false, mp = tmpaddrs.m_next; mp; mp = np)
if (mp->m_nohost) { /* also used to test (hdr->flags & HTRY) */
/* The address doesn't include a host, so it might be an alias. */
pp = akvalue (mp->m_mbox); /* do mh alias substitution */
if (mp->m_nohost) { /* also used to test (hdr->flags & HTRY) */
/* The address doesn't include a host, so it might be an alias. */
pp = akvalue (mp->m_mbox); /* do mh alias substitution */
: (hdr->set & MSND)) {
strncpy(sender, auxformat(mp, 0), sizeof(sender) - 1);
sender[sizeof(sender) - 1] = '\0';
: (hdr->set & MSND)) {
strncpy(sender, auxformat(mp, 0), sizeof(sender) - 1);
sender[sizeof(sender) - 1] = '\0';
}
if (putadr (namep, qp, mp, out, hdr->flags, savehdr,
savehdrlen))
}
if (putadr (namep, qp, mp, out, hdr->flags, savehdr,
savehdrlen))
: (hdr->set & MSND)) {
strncpy(sender, auxformat(mp, 0), sizeof(sender) - 1);
sender[sizeof(sender) - 1] = '\0';
: (hdr->set & MSND)) {
strncpy(sender, auxformat(mp, 0), sizeof(sender) - 1);
sender[sizeof(sender) - 1] = '\0';
if (mp->m_gname)
putgrp (namep, mp->m_gname, out, hdr->flags);
if (mp->m_ingrp)
if (mp->m_gname)
putgrp (namep, mp->m_gname, out, hdr->flags);
if (mp->m_ingrp)
keep = putadr (namep, "", mp, out, hdr->flags, savehdr, savehdrlen);
np = mp->m_next;
if (keep) {
keep = putadr (namep, "", mp, out, hdr->flags, savehdr, savehdrlen);
np = mp->m_next;
if (keep) {
- if (grp > 0 && (hdr->flags & HNGR)) {
+ if (grp && (hdr->flags & HNGR)) {
inform("%s: field does not allow groups", name);
inform("%s: field does not allow groups", name);
}
if (linepos) {
putc ('\n', out);
}
if (linepos) {
putc ('\n', out);
*/
inform("message has no From: header");
inform("See default components files for examples");
*/
inform("message has no From: header");
inform("See default components files for examples");
- if (fromcount > 1 && (seensender == 0 && !(msgflags & MEFM))) {
+ if (fromcount > 1 && (!seensender && !(msgflags & MEFM))) {
inform("A Sender: or Envelope-From: header is required "
"with multiple\nFrom: addresses");
inform("A Sender: or Envelope-From: header is required "
"with multiple\nFrom: addresses");
* from Envelope-From: (which in this case, cannot be blank)
*/
* from Envelope-From: (which in this case, cannot be blank)
*/
- if (fromcount > 1 && seensender == 0) {
+ if (fromcount > 1 && !seensender) {
if (efrom[0] == '\0') {
inform("Envelope-From cannot be blank when there "
"is multiple From: addresses\nand no Sender: "
"header");
if (efrom[0] == '\0') {
inform("Envelope-From cannot be blank when there "
"is multiple From: addresses\nand no Sender: "
"header");
} else {
fprintf (out, "Sender: %s\n", efrom);
}
} else {
fprintf (out, "Sender: %s\n", efrom);
}
case RESENT:
if (!(msgflags & MDAT)) {
inform("message has no Date: header");
case RESENT:
if (!(msgflags & MDAT)) {
inform("message has no Date: header");
}
if (!(msgflags & MFRM)) {
inform("message has no From: header");
}
if (!(msgflags & MFRM)) {
inform("message has no From: header");
}
if (!(msgflags & MRFM)) {
inform("message has no Resent-From: header");
inform("See default components files for examples");
}
if (!(msgflags & MRFM)) {
inform("message has no Resent-From: header");
inform("See default components files for examples");
- if (fromcount > 1 && (seensender == 0 && !(msgflags & MEFM))) {
+ if (fromcount > 1 && (!seensender && !(msgflags & MEFM))) {
inform("A Resent-Sender: or Envelope-From: header is "
"required with multiple\nResent-From: addresses");
inform("A Resent-Sender: or Envelope-From: header is "
"required with multiple\nResent-From: addresses");
* from Envelope-From (which in this case, cannot be blank)
*/
* from Envelope-From (which in this case, cannot be blank)
*/
- if (fromcount > 1 && seensender == 0) {
+ if (fromcount > 1 && !seensender) {
if (efrom[0] == '\0') {
inform("Envelope-From cannot be blank when there "
"is multiple Resent-From: addresses and no "
"Resent-Sender: header");
if (efrom[0] == '\0') {
inform("Envelope-From cannot be blank when there "
"is multiple Resent-From: addresses and no "
"Resent-Sender: header");
} else {
fprintf (out, "Resent-Sender: %s\n", efrom);
}
} else {
fprintf (out, "Resent-Sender: %s\n", efrom);
}
return 0;
mp->m_next = np;
return 0;
mp->m_next = np;
static struct termios tio;
static bool wtuser;
static struct termios tio;
static bool wtuser;
static jmp_buf sigenv;
/*
static jmp_buf sigenv;
/*
int
main (int argc, char **argv)
{
int
main (int argc, char **argv)
{
- int body = 1, prepend = 1, rapid = 0;
- int doteof = 0, fdi, fdo, i, state;
+ bool body = true;
+ bool prepend = true;
+ bool rapid = false;
+ bool doteof = false;
+ int fdi, fdo, i, state;
char *cp, *drft = NULL, *erasep = NULL;
char *killp = NULL, name[NAMESZ], field[NMH_BUFSIZ];
char buffer[BUFSIZ];
char *cp, *drft = NULL, *erasep = NULL;
char *killp = NULL, name[NAMESZ], field[NMH_BUFSIZ];
char buffer[BUFSIZ];
tio.c_cc[VERASE] = save_erase;
}
tio.c_cc[VERASE] = save_erase;
}
SIGNAL2 (SIGINT, intrser);
/*
SIGNAL2 (SIGINT, intrser);
/*
if (wtuser)
longjmp (sigenv, NOTOK);
if (wtuser)
longjmp (sigenv, NOTOK);
int
main (int argc, char **argv)
{
int
main (int argc, char **argv)
{
- int publicsw = -1, zerosw = 0;
- int create = 1;
+ int publicsw = -1;
+ bool zerosw = false;
+ bool create = true;
bool unseensw = true;
int fd, msgnum;
size_t seqp = 0;
bool unseensw = true;
int fd, msgnum;
size_t seqp = 0;
int
main (int argc, char **argv)
{
int
main (int argc, char **argv)
{
- int linkf = 0, preserve = 0;
+ bool linkf = false;
+ bool preserve = false;
bool retainseqs = false;
int filep = 0;
bool retainseqs = false;
int filep = 0;
- int foldp = 0, isdf = 0, unlink_msgs = 0;
+ int foldp = 0, isdf = 0;
+ bool unlink_msgs = false;
int i, msgnum;
char *cp, *folder = NULL, buf[BUFSIZ];
char **argp, **arguments;
int i, msgnum;
char *cp, *folder = NULL, buf[BUFSIZ];
char **argp, **arguments;
continue;
case RETAINSEQSSW:
continue;
case RETAINSEQSSW:
continue;
case NUNLINKSW:
continue;
case NUNLINKSW:
short querysw = 0;
static short outputlinelen = OUTPUTLINELEN;
short querysw = 0;
static short outputlinelen = OUTPUTLINELEN;
-static short groupreply = 0; /* Is this a group reply? */
+static bool groupreply; /* Is this a group reply? */
-static int mime = 0; /* include original as MIME part */
+static bool mime; /* include original as MIME part */
static char *form = NULL; /* form (components) file */
static char *filter = NULL; /* message filter file */
static char *fcc = NULL; /* folders to add to Fcc: header */
static char *form = NULL; /* form (components) file */
static char *filter = NULL; /* message filter file */
static char *fcc = NULL; /* folders to add to Fcc: header */
main (int argc, char **argv)
{
int i, isdf = 0;
main (int argc, char **argv)
{
int i, isdf = 0;
- int nedit = 0, nwhat = 0;
- int atfile = 0;
+ bool nedit = false;
+ bool nwhat = false;
+ bool atfile = false;
int fmtproc = -1;
char *cp, *cwd, *dp, *maildir, *file = NULL;
char *folder = NULL, *msg = NULL, *dfolder = NULL;
int fmtproc = -1;
char *cp, *cwd, *dp, *maildir, *file = NULL;
char *folder = NULL, *msg = NULL, *dfolder = NULL;
struct msgs *mp = NULL;
struct stat st;
FILE *in;
struct msgs *mp = NULL;
struct stat st;
FILE *in;
if (nmh_init(argv[0], true, true)) { return 1; }
if (nmh_init(argv[0], true, true)) { return 1; }
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
die("missing argument to %s", argp[-2]);
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
die("missing argument to %s", argp[-2]);
continue;
case CONVERTARGSW: {
continue;
case CONVERTARGSW: {
case WHATSW:
if (!(whatnowproc = *argp++) || *whatnowproc == '-')
die("missing argument to %s", argp[-2]);
case WHATSW:
if (!(whatnowproc = *argp++) || *whatnowproc == '-')
die("missing argument to %s", argp[-2]);
/* FALLTHRU */
case NWHATSW:
/* FALLTHRU */
case NWHATSW:
if (!(cp = *argp++) || *cp == '-')
die("missing argument to %s", argp[-2]);
filter = mh_xstrdup(etcpath(cp));
if (!(cp = *argp++) || *cp == '-')
die("missing argument to %s", argp[-2]);
filter = mh_xstrdup(etcpath(cp));
continue;
case FORMSW:
if (!(form = *argp++) || *form == '-')
continue;
case FORMSW:
if (!(form = *argp++) || *form == '-')
case FRMTSW:
filter = mh_xstrdup(etcpath(mhlreply));
case FRMTSW:
filter = mh_xstrdup(etcpath(mhlreply));
continue;
case NFRMTSW:
filter = NULL;
continue;
case NFRMTSW:
filter = NULL;
filter = NULL;
continue;
case NMIMESW:
filter = NULL;
continue;
case NMIMESW:
continue;
case NOATFILESW:
continue;
case NOATFILESW:
continue;
case FMTPROCSW:
continue;
case FMTPROCSW:
/*
* We are replying to a file.
*/
/*
* We are replying to a file.
*/
- anot = 0; /* we don't want to annotate a file */
+ anot = false; /* we don't want to annotate a file */
} else {
/*
* We are replying to a message.
} else {
/*
* We are replying to a message.
{
int len;
char baddr[BUFSIZ], error[BUFSIZ];
{
int len;
char baddr[BUFSIZ], error[BUFSIZ];
char *dst;
char *cp;
char *sp;
char *dst;
char *cp;
char *sp;
}
/* concatenate all the new addresses onto 'buf' */
}
/* concatenate all the new addresses onto 'buf' */
- for (isgroup = 0; (cp = getname (fixed_str)); ) {
+ for (isgroup = false; (cp = getname (fixed_str)); ) {
if ((mp = getm (cp, dfhost, dftype, error, sizeof(error))) == NULL) {
snprintf (baddr, sizeof(baddr), "\t%s -- %s\n", cp, error);
badaddrs = add (baddr, badaddrs);
if ((mp = getm (cp, dfhost, dftype, error, sizeof(error))) == NULL) {
snprintf (baddr, sizeof(baddr), "\t%s -- %s\n", cp, error);
badaddrs = add (baddr, badaddrs);
}
if (isgroup && (mp->m_gname || !mp->m_ingrp)) {
*dst++ = ';';
}
if (isgroup && (mp->m_gname || !mp->m_ingrp)) {
*dst++ = ';';
}
if (insert (mp)) {
/* if we get here we're going to add an address */
}
if (insert (mp)) {
/* if we get here we're going to add an address */
if (mp->m_gname) {
CHECKMEM (mp->m_gname);
CPY (mp->m_gname);
if (mp->m_gname) {
CHECKMEM (mp->m_gname);
CPY (mp->m_gname);
}
sp = adrformat (mp);
CHECKMEM (sp);
}
sp = adrformat (mp);
CHECKMEM (sp);
int
main (int argc, char **argv)
{
int
main (int argc, char **argv)
{
- int defolder = 0, interactive = -1;
+ bool defolder = false;
+ int interactive = -1;
char *cp, *folder = NULL, newfolder[BUFSIZ];
char buf[BUFSIZ], **argp, **arguments;
char *fp;
char *cp, *folder = NULL, newfolder[BUFSIZ];
char buf[BUFSIZ], **argp, **arguments;
char *fp;
free (path ("./", TFOLDER));
if (!folder) {
folder = getfolder (1);
free (path ("./", TFOLDER));
if (!folder) {
folder = getfolder (1);
}
fp = m_mailpath(folder);
if (!strcmp(fp, pwd()))
}
fp = m_mailpath(folder);
if (!strcmp(fp, pwd()))
static int
rmf (char *folder)
{
static int
rmf (char *folder)
{
char *fp;
char *maildir;
char cur[BUFSIZ];
char *fp;
char *maildir;
char cur[BUFSIZ];
if ((dd = opendir (".")) == NULL)
die("unable to read folder +%s", folder);
if ((dd = opendir (".")) == NULL)
die("unable to read folder +%s", folder);
/*
* Run the external delete hook program.
/*
* Run the external delete hook program.
inform("file \"%s/%s\" not deleted, continuing...",
folder, dp->d_name);
inform("file \"%s/%s\" not deleted, continuing...",
folder, dp->d_name);
continue;
}
if (m_unlink (dp->d_name) == NOTOK) {
admonish (dp->d_name, "unable to unlink %s:", folder);
continue;
}
if (m_unlink (dp->d_name) == NOTOK) {
admonish (dp->d_name, "unable to unlink %s:", folder);
if (chdir ("..") < 0) {
advise ("..", "chdir");
}
if (chdir ("..") < 0) {
advise ("..", "chdir");
}
- if (others == 0 && remdir (maildir))
+ if (!others && remdir (maildir))
return OK;
inform("folder +%s not removed", folder);
return OK;
inform("folder +%s not removed", folder);
int
main (int argc, char **argv)
{
int
main (int argc, char **argv)
{
- int msgnum, unlink_msgs = 0;
+ int msgnum;
+ bool unlink_msgs = false;
char *cp, *maildir, *folder = NULL;
char buf[BUFSIZ], **argp;
char **arguments;
char *cp, *maildir, *folder = NULL;
char buf[BUFSIZ], **argp;
char **arguments;
continue;
case NUNLINKSW:
continue;
case NUNLINKSW:
int
main (int argc, char **argv)
{
int
main (int argc, char **argv)
{
- int clearflag = 0, hdrflag = 0, ontty;
- int width = -1, revflag = 0;
+ bool clearflag = false;
+ bool hdrflag = false;
+ int ontty;
+ int width = -1;
+ bool revflag = false;
int i, state, msgnum;
ivector_t seqnum = ivector_create (0);
bool unseen;
int i, state, msgnum;
ivector_t seqnum = ivector_create (0);
bool unseen;
width = atoi (cp);
continue;
case REVSW:
width = atoi (cp);
continue;
case REVSW:
}
charstring_free (scanl);
scan_finished ();
}
charstring_free (scanl);
scan_finished ();
fclose (in);
if (ontty)
fflush (stdout);
fclose (in);
if (ontty)
fflush (stdout);
#undef X
extern int debugsw; /* from sendsbr.c */
#undef X
extern int debugsw; /* from sendsbr.c */
-extern int unique;
-extern int verbsw;
+extern bool unique;
+extern bool verbsw;
extern char *altmsg; /* .. */
extern char *annotext;
extern char *altmsg; /* .. */
extern char *annotext;
vec[vecp++] = --cp;
continue;
case NVERBSW:
vec[vecp++] = --cp;
continue;
case NVERBSW:
vec[vecp++] = --cp;
continue;
vec[vecp++] = --cp;
continue;
#endif /* OAUTH_SUPPORT */
int debugsw = 0; /* global */
#endif /* OAUTH_SUPPORT */
int debugsw = 0; /* global */
-int unique = 0;
-int verbsw = 0;
+bool unique;
+bool verbsw;
char *altmsg = NULL; /* .. */
char *annotext = NULL;
char *altmsg = NULL; /* .. */
char *annotext = NULL;
int
main (int argc, char **argv)
{
int
main (int argc, char **argv)
{
- int nshow = 0, checkmime = 1;
+ bool nshow = false;
+ bool checkmime = true;
bool mime = false;
int isdf = 0, mode = SHOW, msgnum;
char *cp, *maildir, *file = NULL, *folder = NULL, *proc, *program;
bool mime = false;
int isdf = 0, mode = SHOW, msgnum;
char *cp, *maildir, *file = NULL, *folder = NULL, *proc, *program;
case DRFTSW:
if (file)
die("only one file at a time!");
case DRFTSW:
if (file)
die("only one file at a time!");
if (mode == SHOW)
continue;
usage:
if (mode == SHOW)
continue;
usage:
case SHOWSW:
if (!(showproc = *argp++) || *showproc == '-')
die("missing argument to %s", argp[-2]);
case SHOWSW:
if (!(showproc = *argp++) || *showproc == '-')
die("missing argument to %s", argp[-2]);
continue;
case SHOWMIMESW:
if (!(showmimeproc = *argp++) || *showmimeproc == '-')
die("missing argument to %s", argp[-2]);
continue;
case SHOWMIMESW:
if (!(showmimeproc = *argp++) || *showmimeproc == '-')
die("missing argument to %s", argp[-2]);
continue;
case CHECKMIMESW:
continue;
case CHECKMIMESW:
continue;
case NOCHECKMIMESW:
continue;
case NOCHECKMIMESW:
static int globbed = 0; /* have we built "vars" table yet? */
static int parsed = 0; /* have we built header field table yet */
static int utmped = 0; /* have we scanned umtp(x) file yet */
static int globbed = 0; /* have we built "vars" table yet? */
static int parsed = 0; /* have we built header field table yet */
static int utmped = 0; /* have we scanned umtp(x) file yet */
-static int suppressdup = 0; /* are we suppressing duplicate messages? */
+static bool suppressdup; /* are we suppressing duplicate messages? */
-static int verbose = 0;
-static int debug = 0;
+static bool verbose;
+static bool debug;
static char *addr = NULL;
static char *user = NULL;
static char *addr = NULL;
static char *user = NULL;
continue;
case SUPPRESSDUP:
continue;
case SUPPRESSDUP:
continue;
case NSUPPRESSDUP:
continue;
case NSUPPRESSDUP:
- int status=1, won, vecp;
+ int status=1;
+ bool won;
+ int vecp;
bool next;
char *field, *pattern, *action, *result, *string;
char buffer[BUFSIZ], tmpbuf[BUFSIZ];
bool next;
char *field, *pattern, *action, *result, *string;
char buffer[BUFSIZ], tmpbuf[BUFSIZ];
next = true;
/* read and process delivery file */
next = true;
/* read and process delivery file */
if (status) next = false; /* action failed, mark for 'N' result */
if (accept && status == 0)
if (status) next = false; /* action failed, mark for 'N' result */
if (accept && status == 0)
char *subjsort; /* sort on subject if != 0 */
time_t datelimit = 0;
char *subjsort; /* sort on subject if != 0 */
time_t datelimit = 0;
-int submajor = 0; /* if true, sort on subject-major */
-int verbose;
+bool submajor; /* if true, sort on subject-major */
+bool verbose;
int allmsgs = 1;
int check_failed = 0;
int allmsgs = 1;
int check_failed = 0;
while (*cp == '0')
cp++; /* skip any leading zeros */
if (!*cp) { /* hit end of string */
while (*cp == '0')
cp++; /* skip any leading zeros */
if (!*cp) { /* hit end of string */
- submajor++; /* sort subject-major */
+ submajor = true; /* sort subject-major */
continue;
}
if (!isdigit((unsigned char) *cp) || !(datelimit = atoi(cp)))
continue;
}
if (!isdigit((unsigned char) *cp) || !(datelimit = atoi(cp)))
datelimit *= 60*60*24;
continue;
case NLIMSW:
datelimit *= 60*60*24;
continue;
case NLIMSW:
- submajor = 0; /* use date-major, but */
- datelimit = 0; /* use no limit */
+ submajor = false; /* use date-major, but */
+ datelimit = 0; /* use no limit */
extern int debugsw;
extern int splitsw;
extern int debugsw;
extern int splitsw;
what_now (char *ed, int nedit, int use, char *file, char *altmsg, int dist,
struct msgs *mp, char *text, int inplace, char *cwd, int atfile)
{
what_now (char *ed, int nedit, int use, char *file, char *altmsg, int dist,
struct msgs *mp, char *text, int inplace, char *cwd, int atfile)
{
- int found, k, msgnum, vecp;
+ bool found;
+ int k, msgnum, vecp;
int len, buflen;
char *bp;
char buffer[BUFSIZ], *vec[MAXARGS];
int len, buflen;
char *bp;
char buffer[BUFSIZ], *vec[MAXARGS];
unsetenv("mhinplace");
if (text && mp && !is_readonly(mp)) {
unsetenv("mhinplace");
if (text && mp && !is_readonly(mp)) {
bp = buffer;
buflen = sizeof(buffer);
for (msgnum = mp->lowmsg; msgnum <= mp->hghmsg; msgnum++) {
bp = buffer;
buflen = sizeof(buffer);
for (msgnum = mp->lowmsg; msgnum <= mp->hghmsg; msgnum++) {
buflen -= len;
}
msgnum = k + 1;
buflen -= len;
}
msgnum = k + 1;
int
WhatNow (int argc, char **argv)
{
int
WhatNow (int argc, char **argv)
{
- int isdf = 0, nedit = 0, use = 0, atfile = 1;
+ int isdf = 0;
+ bool nedit = false;
+ int use = 0, atfile = 1;
char *cp, *dfolder = NULL, *dmsg = NULL;
char *ed = NULL, *drft = NULL, *msgnam = NULL;
char buf[BUFSIZ];
char *cp, *dfolder = NULL, *dmsg = NULL;
char *ed = NULL, *drft = NULL, *msgnam = NULL;
char buf[BUFSIZ];
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
die("missing argument to %s", argp[-2]);
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
die("missing argument to %s", argp[-2]);
if (ed == NULL && ((ed = getenv ("mheditor")) == NULL || *ed == 0)) {
ed = NULL;
if (ed == NULL && ((ed = getenv ("mheditor")) == NULL || *ed == 0)) {
ed = NULL;
}
/* start editing the draft, unless -noedit was given */
}
/* start editing the draft, unless -noedit was given */
-static int reedit = 0; /* have we been here before? */
+static bool reedit; /* have we been here before? */
static char *edsave = NULL; /* the editor we used previously */
static char *edsave = NULL; /* the editor we used previously */
if (altmsg
&& mp
&& !is_readonly(mp)
if (altmsg
&& mp
&& !is_readonly(mp)
extern int debugsw; /* from sendsbr.c */
extern int debugsw; /* from sendsbr.c */
-extern int unique;
-extern int verbsw;
+extern bool unique;
+extern bool verbsw;
extern char *altmsg; /* .. */
extern char *annotext;
extern char *altmsg; /* .. */
extern char *annotext;
argp = arguments;
debugsw = 0;
argp = arguments;
debugsw = 0;
altmsg = NULL;
annotext = NULL;
altmsg = NULL;
annotext = NULL;
vec[vecp++] = --cp;
continue;
case NVERBSW:
vec[vecp++] = --cp;
continue;
case NVERBSW:
vec[vecp++] = --cp;
continue;
vec[vecp++] = --cp;
continue;