From 4922d88794d8fd93f7167359361d64ff3924d576 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 6 Jul 2001 04:02:10 +0000 Subject: Don't crap out when there are no servers. svn path=/trunk/; revision=3402 --- fetchmail.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'fetchmail.c') diff --git a/fetchmail.c b/fetchmail.c index bac5a2f7..5b8c28ea 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -1180,6 +1180,7 @@ static int load_params(int argc, char **argv, int optind) memcpy(ctl->server.trueaddr, namerec->h_addr_list[0], namerec->h_length); + ctl->wedged = FALSE; } #else ctl->server.truename = xstrdup(ctl->server.queryname); @@ -1274,15 +1275,18 @@ static int load_params(int argc, char **argv, int optind) * If all connections are wedged due to DNS errors, quit. This is * important for the common case that you just have one connection. */ - st = PS_DNS; - for (ctl = querylist; ctl; ctl = ctl->next) - if (!ctl->wedged) - st = 0; - if (st == PS_DNS) + if (querylist) { - (void) fprintf(stderr, - _("all mailserver name lookups failed, exiting\n")); - exit(PS_DNS); + st = PS_DNS; + for (ctl = querylist; ctl; ctl = ctl->next) + if (!ctl->wedged) + st = 0; + if (st == PS_DNS) + { + (void) fprintf(stderr, + _("all mailserver name lookups failed, exiting\n")); + exit(PS_DNS); + } } return(implicitmode); -- cgit v1.2.3