diff options
author | Daniel Stenberg <daniel@haxx.se> | 2003-11-07 17:17:15 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2003-11-07 17:17:15 +0000 |
commit | 8be602cdfdfa117e1f771f1a7cdf995ea4ab989b (patch) | |
tree | ae81a668ebc577e7d6bc07a71ef8c5c418016c58 /src/main.c | |
parent | 3dd40cca9a71061fc39f17ca46685e49929d4232 (diff) |
Based on Gisle Vanem's $HOME patch, we now attempt to find the home dir
in a slightly better way for more platforms. The $HOME is only used for
.curlrc atm, but the possible upcoming change of .netrc treatment may also
need the home dir.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c index e5a0caf09..b436ef20b 100644 --- a/src/main.c +++ b/src/main.c @@ -41,6 +41,7 @@ #include "urlglob.h" #include "writeout.h" #include "getpass.h" +#include "homedir.h" #ifdef USE_ENVIRONMENT #include "writeenv.h" #endif @@ -2054,11 +2055,10 @@ static int parseconfig(const char *filename, #define CURLRC DOT_CHAR "curlrc" - filename = CURLRC; /* sensible default */ - home = curl_getenv("HOME"); /* portable environment reader */ + filename = CURLRC; /* sensible default */ + home = homedir(); /* portable homedir finder */ if(home) { if(strlen(home)<(sizeof(filebuffer)-strlen(CURLRC))) { - snprintf(filebuffer, sizeof(filebuffer), "%s%s%s", home, DIR_CHAR, CURLRC); |