aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fetchmail.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/fetchmail.c b/fetchmail.c
index 26db0e07..9b464355 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -791,6 +791,8 @@ static int load_params(int argc, char **argv, int optind)
else
for (; optind < argc; optind++)
{
+ flag predeclared = FALSE;
+
/*
* If hostname corresponds to a host known from the rc file,
* simply declare it active. Otherwise synthesize a host
@@ -799,18 +801,22 @@ static int load_params(int argc, char **argv, int optind)
for (ctl = querylist; ctl; ctl = ctl->next)
if (!strcmp(ctl->server.pollname, argv[optind])
|| str_in_list(&ctl->server.akalist, argv[optind], TRUE))
- goto foundit;
-
- /*
- * Allocate and link record without copying in command-line args;
- * we'll do that with the optmerge call later on.
- */
- ctl = hostalloc((struct query *)NULL);
- ctl->server.via =
- ctl->server.pollname = xstrdup(argv[optind]);
+ {
+ ctl->active = TRUE;
+ predeclared = TRUE;
+ }
- foundit:
- ctl->active = TRUE;
+ if (!predeclared)
+ {
+ /*
+ * Allocate and link record without copying in
+ * command-line args; we'll do that with the optmerge
+ * call later on.
+ */
+ ctl = hostalloc((struct query *)NULL);
+ ctl->server.via =
+ ctl->server.pollname = xstrdup(argv[optind]);
+ }
}
/*