vtls: replaced getenv() with curl_getenv()

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.

Closes #2171
This commit is contained in:
dmitrykos 2017-12-10 20:40:44 +02:00 committed by Daniel Stenberg
parent ef5633d4b3
commit 2437dbbf12
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
1 changed files with 4 additions and 1 deletions

View File

@ -1260,6 +1260,7 @@ static size_t Curl_multissl_version(char *buffer, size_t size)
static int multissl_init(const struct Curl_ssl *backend)
{
const char *env;
char *env_tmp;
int i;
if(Curl_ssl != &Curl_ssl_multi)
@ -1273,7 +1274,7 @@ static int multissl_init(const struct Curl_ssl *backend)
if(!available_backends[0])
return 1;
env = getenv("CURL_SSL_BACKEND");
env = env_tmp = curl_getenv("CURL_SSL_BACKEND");
#ifdef CURL_DEFAULT_SSL_BACKEND
if(!env)
env = CURL_DEFAULT_SSL_BACKEND;
@ -1282,6 +1283,7 @@ static int multissl_init(const struct Curl_ssl *backend)
for(i = 0; available_backends[i]; i++) {
if(strcasecompare(env, available_backends[i]->info.name)) {
Curl_ssl = available_backends[i];
curl_free(env_tmp);
return 0;
}
}
@ -1289,6 +1291,7 @@ static int multissl_init(const struct Curl_ssl *backend)
/* Fall back to first available backend */
Curl_ssl = available_backends[0];
curl_free(env_tmp);
return 0;
}