Re: Use GetEnvironmentVariable() instead of getenv()?
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]
> <https://github.com/curl/curl/blob/b7d1264647eade0dae9f40cd3987071e557753ae/lib/getenv.c#L39>
> [2]<https://bugs.php.net/bug.php?id=79051>
Confirmed. I've opened an issue [1] for further discussion.
[1]: https://github.com/curl/curl/issues/4774
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-01-02