summaryrefslogtreecommitdiff
path: root/src/homedir.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-04-27 21:24:58 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-04-27 21:24:58 +0000
commit78882e46429e05c2a258a5440f06644f588cc224 (patch)
treedd32b19b09da99335b70d589cafffbaf117474fd /src/homedir.c
parent8465a367a41dea71603984b6a6bc08e177ef8a8c (diff)
downloadcurl-78882e46429e05c2a258a5440f06644f588cc224.tar.gz
Paul Moore made curl check for the .curlrc file (_curlrc on windows) on two
more places. First, CURL_HOME is a new environment variable that is used instead of HOME if it is set, to point out where the default config file lives. If there's no config file in the dir pointed out by one of the environment variables, the Windows version will instead check the same directory the executable curl is located in.
Diffstat (limited to 'src/homedir.c')
-rw-r--r--src/homedir.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/homedir.c b/src/homedir.c
index 69fbc467c..694b9bc79 100644
--- a/src/homedir.c
+++ b/src/homedir.c
@@ -87,7 +87,13 @@ char *GetEnv(const char *variable, char do_expand)
/* return the home directory of the current user as an allocated string */
char *homedir(void)
{
- char *home = GetEnv("HOME", FALSE);
+ char *home;
+
+ home = GetEnv("CURL_HOME", FALSE);
+ if(home)
+ return home;
+
+ home = GetEnv("HOME", FALSE);
if(home)
return home;