From: Viktor Szakats Date: Thu, 9 Apr 2015 01:46:15 +0000 (+0200) Subject: netrc: support 'default' token X-Git-Tag: curl-7_43_0~223 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48be87e5f0bdf307481c44988f7f4123afbb1da7;p=thirdparty%2Fcurl.git netrc: support 'default' token The 'default' token has no argument and means to match _any_ domain. It must be placed last if there are 'machine ' tokens in the same file. See full description here: https://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-File.html --- diff --git a/lib/netrc.c b/lib/netrc.c index 6271a3a2fe..e656cf7c6d 100644 --- a/lib/netrc.c +++ b/lib/netrc.c @@ -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)) {