Skip to content

Commit ebc298d

Browse files
committed
squash! mingw: HOT FIX: work around environment issues -- again
cURL actually uses "cp" + GetACP(): https://github.com/bagder/curl/blob/aa5808b5/lib/easy.c#L157-L162
1 parent 8d76720 commit ebc298d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

compat/mingw.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -2332,8 +2332,12 @@ void mingw_startup()
23322332
* Avoid a segmentation fault when cURL tries to set the CHARSET
23332333
* variable and putenv() barfs at our nedmalloc'ed environment.
23342334
*/
2335-
if (!getenv("CHARSET"))
2336-
setenv("CHARSET", "cp1252", 1);
2335+
if (!getenv("CHARSET")) {
2336+
struct strbuf buf = STRBUF_INIT;
2337+
strbuf_addf(&buf, "cp%u", GetACP());
2338+
setenv("CHARSET", buf.buf, 1);
2339+
strbuf_release(&buf);
2340+
}
23372341

23382342
/* initialize critical section for waitpid pinfo_t list */
23392343
InitializeCriticalSection(&pinfo_cs);

0 commit comments

Comments
 (0)