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 <curl-library_at_cool.haxx.se>
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()?

[1]
<https://github.com/curl/curl/blob/b7d1264647eade0dae9f40cd3987071e557753ae/lib/getenv.c#L39>
[2] <https://bugs.php.net/bug.php?id=79051>

Regards,
Christoph
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-01-02