mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-16 04:51:48 +08:00
93 lines
3.0 KiB
Diff
93 lines
3.0 KiB
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 0caf3dc..de9fcdb 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -941,7 +941,9 @@ check_symbol_exists(ioctl "${CURL_INCLUDES}" HAVE_IOCTL)
|
|
check_symbol_exists(setsockopt "${CURL_INCLUDES}" HAVE_SETSOCKOPT)
|
|
|
|
# symbol exists in win32, but function does not.
|
|
-if(WIN32)
|
|
+if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
|
+ add_definitions(-D_WIN32_WINNT=0x0A00 -DHAVE_STRUCT_POLLFD -D_WINSOCK_DEPRECATED_NO_WARNINGS)
|
|
+elseif(WIN32)
|
|
if(ENABLE_INET_PTON)
|
|
check_function_exists(inet_pton HAVE_INET_PTON)
|
|
# _WIN32_WINNT_VISTA (0x0600)
|
|
diff --git a/lib/curl_gethostname.c b/lib/curl_gethostname.c
|
|
index 8337c72..41867b2 100644
|
|
--- a/lib/curl_gethostname.c
|
|
+++ b/lib/curl_gethostname.c
|
|
@@ -21,6 +21,7 @@
|
|
***************************************************************************/
|
|
|
|
#include "curl_setup.h"
|
|
+#include "curl/curl.h"
|
|
|
|
#include "curl_gethostname.h"
|
|
|
|
@@ -64,9 +65,10 @@ int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen)
|
|
#ifdef DEBUGBUILD
|
|
|
|
/* Override host name when environment variable CURL_GETHOSTNAME is set */
|
|
- const char *force_hostname = getenv("CURL_GETHOSTNAME");
|
|
+ char *force_hostname = curl_getenv("CURL_GETHOSTNAME");
|
|
if(force_hostname) {
|
|
strncpy(name, force_hostname, namelen);
|
|
+ free(force_hostname);
|
|
err = 0;
|
|
}
|
|
else {
|
|
diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c
|
|
index aea5452..c1f59f2 100644
|
|
--- a/lib/curl_ntlm_core.c
|
|
+++ b/lib/curl_ntlm_core.c
|
|
@@ -700,9 +700,12 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash,
|
|
|
|
/* Calculate the timestamp */
|
|
#ifdef DEBUGBUILD
|
|
- char *force_timestamp = getenv("CURL_FORCETIME");
|
|
- if(force_timestamp)
|
|
+ char *force_timestamp = curl_getenv("CURL_FORCETIME");
|
|
+ if (force_timestamp)
|
|
+ {
|
|
tw = CURL_OFF_T_C(11644473600) * 10000000;
|
|
+ free(force_timestamp);
|
|
+ }
|
|
else
|
|
#endif
|
|
tw = ((curl_off_t)time(NULL) + CURL_OFF_T_C(11644473600)) * 10000000;
|
|
diff --git a/lib/ftp.c b/lib/ftp.c
|
|
index 6e86e53..a96fe1a 100644
|
|
--- a/lib/ftp.c
|
|
+++ b/lib/ftp.c
|
|
@@ -4292,7 +4292,7 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
|
|
/* prevpath is "raw" so we convert the input path before we compare the
|
|
strings */
|
|
size_t dlen;
|
|
- char *path;
|
|
+ char *path = NULL;
|
|
CURLcode result =
|
|
Curl_urldecode(conn->data, data->state.path, 0, &path, &dlen, FALSE);
|
|
if(result) {
|
|
diff --git a/lib/rand.c b/lib/rand.c
|
|
index 2713a0a..7da6e00 100644
|
|
--- a/lib/rand.c
|
|
+++ b/lib/rand.c
|
|
@@ -44,7 +44,7 @@ static CURLcode randit(struct Curl_easy *data, unsigned int *rnd)
|
|
static bool seeded = FALSE;
|
|
|
|
#ifdef CURLDEBUG
|
|
- char *force_entropy = getenv("CURL_ENTROPY");
|
|
+ char *force_entropy = curl_getenv("CURL_ENTROPY");
|
|
if(force_entropy) {
|
|
if(!seeded) {
|
|
unsigned int seed = 0;
|
|
@@ -58,6 +58,7 @@ static CURLcode randit(struct Curl_easy *data, unsigned int *rnd)
|
|
else
|
|
randseed++;
|
|
*rnd = randseed;
|
|
+ free(force_entropy);
|
|
return CURLE_OK;
|
|
}
|
|
#endif
|