Fixed undefined symbol of getenv() which does not exist in WinRT. #2171

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

dmitrykos commented Dec 10, 2017

Fixed undefined symbol of getenv() which does not exist when compiling for Windows 10 App (CURL_WINDOWS_APP).

Replaced getenv() with curl_getenv() which is aware of getenv() absence when CURL_WINDOWS_APP is defined.

Fixed undefined symbol of getenv() which does not exist when compilin…
…g for Windows 10 App (CURL_WINDOWS_APP). Replaced getenv() with curl_getenv() which is aware of getenv() absence when CURL_WINDOWS_APP is defined.
Owner

bagder commented Dec 10, 2017

Thanks, but it seems your change doesn't follow our code style correctly:

./vtls/vtls.c:1286:2: error: Contains TAB character (TABS)
 		curl_free(env_tmp);
  ^
Contributor

dmitrykos commented Dec 11, 2017

Sorry, forgot to check for tabs! Removed them as advised.

Owner

bagder commented Dec 12, 2017

Thanks!

@bagder bagder closed this in 2437dbb Dec 12, 2017

Member

gvanem commented Dec 13, 2017

Replaced getenv() with curl_getenv() which is aware of getenv() absence when CURL_WINDOWS_APP
is defined.

What good does a curl_getenv() that always returns NULL for an UWP-app do? Does your app really work? According to MSDN, UWP-apps do have GetEnvironmentVariable(). No?

Contributor

dmitrykos commented Dec 13, 2017

What good does a curl_getenv() that always returns NULL for an UWP-app do? Does your app really work?

In this given context if curl_getenv("CURL_SSL_BACKEND") returns NULL then the first SSL backend is selected which is defined during a compile time in available_backends[0]. Should not be any problem at all.

Reference UWP app works correctly if curl_getenv() returns NULL, no problems observed within its scope of curl usage - HTTP(-S), FTP.

GetEnvironmentVariable would be useless for the Windows 10 Mobile platform as there is no way to set own environment variables if I am not mistaken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment