Skip to content

Commit

Permalink
squash! mingw: HOT FIX: work around environment issues -- again
Browse files Browse the repository at this point in the history
  • Loading branch information
dscho committed Apr 7, 2015
1 parent 8d76720 commit ebc298d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions compat/mingw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2332,8 +2332,12 @@ void mingw_startup()
* Avoid a segmentation fault when cURL tries to set the CHARSET
* variable and putenv() barfs at our nedmalloc'ed environment.
*/
if (!getenv("CHARSET"))
setenv("CHARSET", "cp1252", 1);
if (!getenv("CHARSET")) {
struct strbuf buf = STRBUF_INIT;
strbuf_addf(&buf, "cp%u", GetACP());
setenv("CHARSET", buf.buf, 1);
strbuf_release(&buf);
}

/* initialize critical section for waitpid pinfo_t list */
InitializeCriticalSection(&pinfo_cs);
Expand Down

0 comments on commit ebc298d

Please sign in to comment.