aboutsummaryrefslogtreecommitdiffstats
path: root/driver.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-12-14 21:27:50 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-12-14 21:27:50 +0000
commitb877a3f40400be9035d96b855b94c73a6f92c779 (patch)
treeca53d5783774ad4cbfdfcc4ca9f7692526071ad6 /driver.c
parentf191f75af5ce76ce9ed72224bc3585ba9a39a73e (diff)
downloadfetchmail-b877a3f40400be9035d96b855b94c73a6f92c779.tar.gz
fetchmail-b877a3f40400be9035d96b855b94c73a6f92c779.tar.bz2
fetchmail-b877a3f40400be9035d96b855b94c73a6f92c779.zip
Cleanup of numeric option handling.
svn path=/trunk/; revision=1568
Diffstat (limited to 'driver.c')
-rw-r--r--driver.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/driver.c b/driver.c
index 15c751b4..61438f91 100644
--- a/driver.c
+++ b/driver.c
@@ -392,7 +392,7 @@ static int smtp_open(struct query *ctl)
/* try to open a socket to the appropriate SMTP server for this query */
{
/* maybe it's time to close the socket in order to force delivery */
- if (ctl->batchlimit > 0 && (ctl->smtp_socket != -1) && batchcount++ == ctl->batchlimit)
+ if (NUM_NONZERO(ctl->batchlimit) && (ctl->smtp_socket != -1) && batchcount++ == ctl->batchlimit)
{
close(ctl->smtp_socket);
ctl->smtp_socket = -1;
@@ -1465,7 +1465,7 @@ const struct method *proto; /* protocol method table */
return(PS_SYNTAX);
}
}
- if (!proto->getsizes && ctl->limit)
+ if (!proto->getsizes && NUM_SPECIFIED(ctl->limit))
{
error(0, 0,
"Option --limit is not supported with %s",
@@ -1692,7 +1692,7 @@ const struct method *proto; /* protocol method table */
/* read, forward, and delete messages */
for (num = 1; num <= count; num++)
{
- flag toolarge = (ctl->limit > 0)
+ flag toolarge = NUM_NONZERO(ctl->limit)
&& msgsizes && (msgsizes[num-1] > ctl->limit);
flag fetch_it = !toolarge
&& (ctl->fetchall || force_retrieval || !(protocol->is_old && (protocol->is_old)(sock,ctl,num)));
@@ -1929,7 +1929,7 @@ const struct method *proto; /* protocol method table */
error_complete(0, 0, " not flushed");
/* perhaps this as many as we're ready to handle */
- if (ctl->fetchlimit > 0 && ctl->fetchlimit <= fetches)
+ if (NUM_NONZERO(ctl->fetchlimit) && ctl->fetchlimit <= fetches)
goto no_error;
}
}