Skip to content

Commit

Permalink
netrc: support 'default' token
Browse files Browse the repository at this point in the history
The 'default' token has no argument and means to match _any_ domain.
It must be placed last if there are 'machine <name>' tokens in the same file.

See full description here:
https://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-File.html
  • Loading branch information
vszakats authored and bagder committed Apr 24, 2015
1 parent 4972692 commit 48be87e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/netrc.c
Expand Up @@ -137,6 +137,10 @@ int Curl_parsenetrc(const char *host,
'password'. */
state=HOSTFOUND;
}
else if(Curl_raw_equal("default", tok)) {
state=HOSTVALID;
retcode=0; /* we did find our host */
}
break;
case HOSTFOUND:
if(Curl_raw_equal(host, tok)) {
Expand Down

0 comments on commit 48be87e

Please sign in to comment.