aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-11-24 11:41:26 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-11-24 11:41:26 +0000
commit96d7a95ce4f0b5c61a5f56ad615f38c2774da422 (patch)
tree55d09ed5842b108652eee6650506b8340ba2b3de
parentd5d55a856ea70ea6fab1a21821ae3fdb4e921d82 (diff)
windows build fix based on a patch by Gisle Vanem
-rw-r--r--lib/netrc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/netrc.c b/lib/netrc.c
index c6443608e..5c7a8792a 100644
--- a/lib/netrc.c
+++ b/lib/netrc.c
@@ -92,6 +92,8 @@ int Curl_parsenetrc(char *host,
char state_password=0; /* Found a password keyword */
char state_our_login=0; /* With specific_login, found *our* login name */
+#define NETRC DOT_CHAR "netrc"
+
#ifdef CURLDEBUG
{
/* This is a hack to allow testing.
@@ -101,14 +103,13 @@ int Curl_parsenetrc(char *host,
char *override = curl_getenv("CURL_DEBUG_NETRC");
if (override) {
- printf("NETRC: overridden .netrc file: %s\n", home);
+ printf("NETRC: overridden " NETRC " file: %s\n", home);
netrcfile = override;
netrc_alloc = TRUE;
}
}
#endif /* CURLDEBUG */
if(!netrcfile) {
-#define NETRC DOT_CHAR "netrc"
#if defined(HAVE_GETPWUID) && defined(HAVE_GETEUID)
struct passwd *pw;
pw= getpwuid(geteuid());
@@ -121,7 +122,7 @@ int Curl_parsenetrc(char *host,
}
#endif
- if(NULL == pw) {
+ if(!home) {
home = curl_getenv("HOME"); /* portable environment reader */
if(!home)
return -1;