Skip to content

Commit

Permalink
punycode2idn also requires IDN support in curl
Browse files Browse the repository at this point in the history
  • Loading branch information
vszakats committed Nov 14, 2023
1 parent 1082bf6 commit cb43a54
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions trurl.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,30 +196,35 @@ static void show_version(void)
PROGNAME, TRURL_VERSION_TXT, data->version, LIBCURL_VERSION);
/* puny code isn't guaranteed based on the version, so it must be polled
* from libcurl */
#if defined(SUPPORTS_PUNYCODE) || defined(SUPPORTS_PUNY2IDN)
bool supports_puny = false;
#ifdef SUPPORTS_PUNYCODE
const char *const *feature_name = data->feature_names;
while(*feature_name && !supports_puny) {
supports_puny = !strncmp(*feature_name, "IDN", 3);
feature_name++;
}
#endif

fprintf(stdout, "features: %s", supports_puny?"punycode ":"");
fprintf(stdout, "features:");
#ifdef SUPPORTS_PUNY2IDN
if(supports_puny)
fprintf(stdout, " punycode");
#endif
#ifdef SUPPORTS_ALLOW_SPACE
fprintf(stdout, "white-space ");
fprintf(stdout, " white-space");
#endif
#ifdef SUPPORTS_ZONEID
fprintf(stdout, "zone-id ");
fprintf(stdout, " zone-id");
#endif
#ifdef SUPPORTS_URL_STRERROR
fprintf(stdout, "url-strerror ");
fprintf(stdout, " url-strerror");
#endif
#ifdef SUPPORTS_NORM_IPV4
fprintf(stdout, "normalize-ipv4 ");
fprintf(stdout, " normalize-ipv4");
#endif
#ifdef SUPPORTS_PUNY2IDN
fprintf(stdout, "punycode2idn");
if(supports_puny)
fprintf(stdout, " punycode2idn");
#endif

fprintf(stdout, "\n");
Expand Down

0 comments on commit cb43a54

Please sign in to comment.