From 7bdb93ae05492627dec400bd2bdf1d0272513679 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 28 Mar 1999 18:07:22 +0000 Subject: Fix .netrc code to search on both host and user name. svn path=/trunk/; revision=2417 --- fetchmail.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'fetchmail.c') diff --git a/fetchmail.c b/fetchmail.c index 685389fb..54e54405 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -428,9 +428,8 @@ int main (int argc, char **argv) netrc_entry *p; /* look up the pollname and account in the .netrc file. */ - p = search_netrc(netrc_list, ctl->server.pollname); - while (p && strcmp(p->account, ctl->remotename)) - p = search_netrc(p->next, ctl->remotename); + p = search_netrc(netrc_list, + ctl->server.pollname, ctl->remotename); /* if we find a matching entry with a password, use it */ if (p && p->password) ctl->password = xstrdup(p->password); @@ -438,9 +437,8 @@ int main (int argc, char **argv) /* otherwise try with "via" name if there is one */ else if (ctl->server.via) { - p = search_netrc(netrc_list, ctl->server.via); - while (p && strcmp(p->account, ctl->remotename)) - p = search_netrc(p->next, ctl->remotename); + p = search_netrc(netrc_list, + ctl->server.via, ctl->remotename); if (p && p->password) ctl->password = xstrdup(p->password); } -- cgit v1.2.3