X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/dbdbd49d59ae5c14e66b1c148a63b8abc9d076ab..a062e4ec504f324c5d5ea7907fef3a737f4d742a:/uip/slocal.c diff --git a/uip/slocal.c b/uip/slocal.c index 98c1af16..8677b3f2 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -83,10 +83,10 @@ DEFINE_SWITCH_ARRAY(SLOCAL, switches); 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; @@ -251,20 +251,20 @@ main (int argc, char **argv) continue; case VERBSW: - verbose++; + verbose = true; continue; case NVERBSW: - verbose = 0; + verbose = false; continue; case SUPPRESSDUP: - suppressdup++; + suppressdup = true; continue; case NSUPPRESSDUP: - suppressdup = 0; + suppressdup = false; continue; case DEBUGSW: - debug++; + debug = true; continue; } } else { @@ -421,7 +421,12 @@ localmail (int fd, char *mdlvr) static int usr_delivery (int fd, char *delivery, int su) { - int i, accept, status=1, won, vecp, next; + int i; + bool accept; + int status=1; + bool won; + int vecp; + bool next; char *field, *pattern, *action, *result, *string; char buffer[BUFSIZ], tmpbuf[BUFSIZ]; char *vec[NVEC]; @@ -444,8 +449,8 @@ usr_delivery (int fd, char *delivery, int su) return -1; } - won = 0; - next = 1; + won = false; + next = true; /* read and process delivery file */ while (fgets (buffer, sizeof(buffer), fp)) { @@ -503,7 +508,7 @@ usr_delivery (int fd, char *delivery, int su) * Take action, and consider delivered if * action is successful. */ - accept = 1; + accept = true; break; case 'R': @@ -513,7 +518,7 @@ usr_delivery (int fd, char *delivery, int su) * Take action, but don't consider delivered, even * if action is successful */ - accept = 0; + accept = false; break; } @@ -556,9 +561,9 @@ usr_delivery (int fd, char *delivery, int su) */ if ((p = lookup (hdrs, field)) && (p->p_value != NULL) && matches (p->p_value, pattern)) { - next = 1; + next = true; } else { - next = 0; + next = false; continue; } break; @@ -630,10 +635,10 @@ usr_delivery (int fd, char *delivery, int su) break; } - if (status) next = 0; /* action failed, mark for 'N' result */ + if (status) next = false; /* action failed, mark for 'N' result */ if (accept && status == 0) - won++; + won = true; } fclose (fp);