Skip to content

Commit

Permalink
netrc: Use a filename variable rather than the NETRC pre-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
captain-caveman2k committed Jun 17, 2019
1 parent fdc249a commit 7452678
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/netrc.c
Expand Up @@ -75,6 +75,7 @@ int Curl_parsenetrc(const char *host,
name */

if(!netrcfile) {
char *filename = NETRC; /* sensible default */
char *home = curl_getenv("HOME"); /* portable environment reader */
if(home) {
#if defined(HAVE_GETPWUID_R) && defined(HAVE_GETEUID)
Expand Down Expand Up @@ -102,7 +103,7 @@ int Curl_parsenetrc(const char *host,
if(!home)
return retcode; /* no home directory found (or possibly out of memory) */

netrcfile = curl_maprintf("%s%s%s", home, DIR_CHAR, NETRC);
netrcfile = curl_maprintf("%s%s%s", home, DIR_CHAR, filename);
free(home);
if(!netrcfile) {
return -1;
Expand Down

0 comments on commit 7452678

Please sign in to comment.