]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
netrc: restore _netrc fallback logic
authorKevin Sun <kevin.sun@intel.com>
Fri, 13 Dec 2024 01:35:12 +0000 (17:35 -0800)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 13 Dec 2024 09:08:00 +0000 (10:08 +0100)
Regression from 05977f4f75fd08837a877, shipped in 8.11.0

Fixes #15734
Closes #15735

lib/netrc.c

index d5ee3c0fd564a8ad2a50c5dcf9183989e90dc9d2..056ea96a7c801001b190e3380aa693d618c873f8 100644 (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) {