curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Use GetEnvironmentVariable() instead of getenv()?

From: Christoph M. Becker via curl-library <>
Date: Thu, 2 Jan 2020 15:56:35 +0100

Hi all,

I've noticed that curl_getenv() uses getenv() on Windows[1]. However,
environment variables set with SetEnvironmentVariable() are not seen by
getenv() (although GetEnvironmentVariable() sees changes done by
putenv()), and since SetEnvironmentVariable() is preferable to putenv()
because the former is thread-safe, this can be an issue. At least it
affects thread-safe PHP builds[2].

Is there anything that prevents libcurl to use GetEnvironmentVariable()
instead of getenv()?

[2] <>

Received on 2020-01-02