summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-08-15 13:36:28 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-08-15 13:36:58 (GMT)
commit3265458a7902ea4c86572349556bde165d183a50 (patch)
tree9e38b011955790147a7837b45669fe5f351349ec
parent16b684786181b63a9e6798ce765dff2979a55ab5 (diff)
parent1a74f95656e9c66632ff9f5cc18b027852311340 (diff)
downloadCMake-3265458a7902ea4c86572349556bde165d183a50.zip
CMake-3265458a7902ea4c86572349556bde165d183a50.tar.gz
CMake-3265458a7902ea4c86572349556bde165d183a50.tar.bz2
Merge topic 'macos-curl-user-agent' into release-3.30
1a74f95656 file(DOWNLOAD): Fix User-Agent to use run-time curl version Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !9726
-rw-r--r--Source/cmFileCommand.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 4797c06..08baca0 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -2131,7 +2131,10 @@ bool HandleDownloadCommand(std::vector<std::string> const& args,
res = ::curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
check_curl_result(res, "DOWNLOAD cannot set http failure option: ");
- res = ::curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/" LIBCURL_VERSION);
+ curl_version_info_data* cv = curl_version_info(CURLVERSION_FIRST);
+ res = ::curl_easy_setopt(
+ curl, CURLOPT_USERAGENT,
+ cmStrCat("curl/", cv ? cv->version : LIBCURL_VERSION).c_str());
check_curl_result(res, "DOWNLOAD cannot set user agent option: ");
res = ::curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, cmWriteToFileCallback);