diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1999-03-28 18:07:22 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1999-03-28 18:07:22 +0000 |
commit | 7bdb93ae05492627dec400bd2bdf1d0272513679 (patch) | |
tree | 0e40c2fc709a4c2d278e3f50d7351bb06bff465d /fetchmail.c | |
parent | 5721f1666e25e0ba370e7333a4e86e91d517da6a (diff) | |
download | fetchmail-7bdb93ae05492627dec400bd2bdf1d0272513679.tar.gz fetchmail-7bdb93ae05492627dec400bd2bdf1d0272513679.tar.bz2 fetchmail-7bdb93ae05492627dec400bd2bdf1d0272513679.zip |
Fix .netrc code to search on both host and user name.
svn path=/trunk/; revision=2417
Diffstat (limited to 'fetchmail.c')
-rw-r--r-- | fetchmail.c | 10 |
1 files changed, 4 insertions, 6 deletions
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); } |