mirror of
https://github.com/moparisthebest/curl
synced 2024-11-13 13:05:03 -05:00
windows build fix based on a patch by Gisle Vanem
This commit is contained in:
parent
d5d55a856e
commit
96d7a95ce4
@ -92,6 +92,8 @@ int Curl_parsenetrc(char *host,
|
|||||||
char state_password=0; /* Found a password keyword */
|
char state_password=0; /* Found a password keyword */
|
||||||
char state_our_login=0; /* With specific_login, found *our* login name */
|
char state_our_login=0; /* With specific_login, found *our* login name */
|
||||||
|
|
||||||
|
#define NETRC DOT_CHAR "netrc"
|
||||||
|
|
||||||
#ifdef CURLDEBUG
|
#ifdef CURLDEBUG
|
||||||
{
|
{
|
||||||
/* This is a hack to allow testing.
|
/* This is a hack to allow testing.
|
||||||
@ -101,14 +103,13 @@ int Curl_parsenetrc(char *host,
|
|||||||
char *override = curl_getenv("CURL_DEBUG_NETRC");
|
char *override = curl_getenv("CURL_DEBUG_NETRC");
|
||||||
|
|
||||||
if (override) {
|
if (override) {
|
||||||
printf("NETRC: overridden .netrc file: %s\n", home);
|
printf("NETRC: overridden " NETRC " file: %s\n", home);
|
||||||
netrcfile = override;
|
netrcfile = override;
|
||||||
netrc_alloc = TRUE;
|
netrc_alloc = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* CURLDEBUG */
|
#endif /* CURLDEBUG */
|
||||||
if(!netrcfile) {
|
if(!netrcfile) {
|
||||||
#define NETRC DOT_CHAR "netrc"
|
|
||||||
#if defined(HAVE_GETPWUID) && defined(HAVE_GETEUID)
|
#if defined(HAVE_GETPWUID) && defined(HAVE_GETEUID)
|
||||||
struct passwd *pw;
|
struct passwd *pw;
|
||||||
pw= getpwuid(geteuid());
|
pw= getpwuid(geteuid());
|
||||||
@ -121,7 +122,7 @@ int Curl_parsenetrc(char *host,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(NULL == pw) {
|
if(!home) {
|
||||||
home = curl_getenv("HOME"); /* portable environment reader */
|
home = curl_getenv("HOME"); /* portable environment reader */
|
||||||
if(!home)
|
if(!home)
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user