cURL-build-win32/patch/curl_tool_parsecfg.diff

40 lines
1.3 KiB
Diff
Raw Normal View History

2024-11-12 15:17:57 +01:00
src/tool_parsecfg.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
2024-08-01 22:24:44 +02:00
diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c
2024-11-12 15:17:57 +01:00
index d79e869f0..93eb2a428 100644
2024-08-01 22:24:44 +02:00
--- a/src/tool_parsecfg.c
+++ b/src/tool_parsecfg.c
2024-11-12 15:17:57 +01:00
@@ -57,7 +57,7 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
2022-06-21 22:03:39 +02:00
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) {
2024-11-12 15:17:57 +01:00
@@ -68,14 +68,16 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
2021-06-10 01:50:43 +02:00
}
2023-12-07 01:29:52 +01:00
#ifdef _WIN32 /* Windows */
2022-06-21 22:03:39 +02:00
else {
- char *fullp;
2024-11-12 15:17:57 +01:00
+ TCHAR *fullp;
2021-06-10 01:50:43 +02:00
/* check for .curlrc then _curlrc in the dir of the executable */
2024-11-12 15:17:57 +01:00
- file = Curl_execpath(".curlrc", &fullp);
- if(!file)
- file = Curl_execpath("_curlrc", &fullp);
+ file = Curl_execpath(TEXT(".curlrc"), &fullp);
2022-06-21 22:03:39 +02:00
if(file)
2024-11-12 15:17:57 +01:00
- /* this is the filename we read from */
2022-06-21 22:03:39 +02:00
- filename = fullp;
+ filename = ".curlrc";
2024-11-12 15:17:57 +01:00
+ else {
+ file = Curl_execpath(TEXT("_curlrc"), &fullp);
+ if(file)
+ filename = "_curlrc";
+ }
2021-06-10 01:50:43 +02:00
}
#endif
2022-06-21 22:03:39 +02:00
}