netrc: restore _netrc fallback logic

Regression from 05977f4f75fd08837a877, shipped in 8.11.0

Fixes #15734
Closes #15735
This commit is contained in:
Kevin Sun 2024-12-12 17:35:12 -08:00 committed by Daniel Stenberg
parent c2ac9ea1ee
commit 0439499170
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -390,7 +390,7 @@ int Curl_parsenetrc(struct store_netrc *store, const char *host,
retcode = parsenetrc(store, host, loginp, passwordp, filealloc);
free(filealloc);
#ifdef _WIN32
if(retcode == NETRC_FILE_MISSING) {
if((retcode == NETRC_FILE_MISSING) || (retcode == NETRC_FAILED)) {
/* fallback to the old-style "_netrc" file */
filealloc = aprintf("%s%s_netrc", home, DIR_CHAR);
if(!filealloc) {