diff --git a/lib/netrc.c b/lib/netrc.c index 33ced71c5d815fb9dd75e31558ab74114a0a0fba..29f77da2584c9cc60d0eee4206d9022dfec243de 100644 --- a/lib/netrc.c +++ b/lib/netrc.c @@ -255,11 +255,16 @@ static int parsenetrc(const char *host, } /* while Curl_get_line() */ out: - if(!retcode && !password && state_our_login) { - /* success without a password, set a blank one */ - password = strdup(""); - if(!password) - retcode = 1; /* out of memory */ + if(!retcode) { + if(!password && state_our_login) { + /* success without a password, set a blank one */ + password = strdup(""); + if(!password) + retcode = 1; /* out of memory */ + } + else if(!login && !password) + /* a default with no credentials */ + retcode = NETRC_FILE_MISSING; } if(!retcode) { /* success */