aboutsummaryrefslogtreecommitdiff
path: root/lib/version.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/version.c')
-rw-r--r--lib/version.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/version.c b/lib/version.c
index 3f981e2b5..7bd4dbe50 100644
--- a/lib/version.c
+++ b/lib/version.c
@@ -132,8 +132,10 @@ char *curl_version(void)
ptr += strlen(ptr);
#endif
#ifdef USE_LIBIDN
- sprintf(ptr, " libidn/%s", stringprep_check_version(NULL));
- ptr += strlen(ptr);
+ if(stringprep_check_version(LIBIDN_REQUIRED_VERSION)) {
+ sprintf(ptr, " libidn/%s", stringprep_check_version(NULL));
+ ptr += strlen(ptr);
+ }
#endif
return version;
@@ -209,9 +211,6 @@ static curl_version_info_data version_info = {
#if defined(ENABLE_64BIT) && (SIZEOF_CURL_OFF_T > 4)
| CURL_VERSION_LARGEFILE
#endif
-#ifdef USE_LIBIDN
- | CURL_VERSION_IDN
-#endif
,
NULL, /* ssl_version */
0, /* ssl_version_num */
@@ -245,6 +244,13 @@ curl_version_info_data *curl_version_info(CURLversion stamp)
version_info.ares_num = aresnum;
}
#endif
+#ifdef USE_LIBIDN
+ /* This returns a version string if we use the given version or later,
+ otherwise it returns NULL */
+ version_info.libidn = stringprep_check_version(LIBIDN_REQUIRED_VERSION);
+ if(version_info.libidn)
+ version_info.features |= CURL_VERSION_IDN;
+#endif
(void)stamp; /* avoid compiler warnings, we don't use this */
return &version_info;