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.

Re: Use GetEnvironmentVariable() instead of getenv()?

From: Ray Satiro via curl-library <>
Date: Thu, 2 Jan 2020 17:07:38 -0500

On 1/2/2020 9:56 AM, Christoph M. Becker via curl-library wrote:
> 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()?
> [1]
> <>
> [2]<>

Confirmed. I've opened an issue [1] for further discussion.


Received on 2020-01-02