src/tool_parsecfg.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c index 651ec8e..406f774 100644 --- a/src/tool_parsecfg.c +++ b/src/tool_parsecfg.c @@ -55,7 +55,7 @@ int parseconfig(const char *filename, struct GlobalConfig *global) if(!filename) { /* NULL means load .curlrc from homedir! */ - char *curlrc = findfile(".curlrc", CURLRC_DOTSCORE); + char *curlrc = NULL; /* findfile(".curlrc", CURLRC_DOTSCORE); */ if(curlrc) { file = fopen(curlrc, FOPEN_READTEXT); if(!file) { @@ -66,14 +66,16 @@ int parseconfig(const char *filename, struct GlobalConfig *global) } #ifdef _WIN32 /* Windows */ else { - char *fullp; + TCHAR *fullp; /* check for .curlrc then _curlrc in the dir of the executable */ - file = Curl_execpath(".curlrc", &fullp); - if(!file) - file = Curl_execpath("_curlrc", &fullp); + file = Curl_execpath(TEXT(".curlrc"), &fullp); if(file) - /* this is the filename we read from */ - filename = fullp; + filename = ".curlrc"; + else { + file = Curl_execpath(TEXT("_curlrc"), &fullp); + if(file) + filename = "_curlrc"; + } } #endif }