noproxy: fix build on systems without IPv6

Follow-up to ff2aaed9ba
Reported-by: Harry Sintonen
Closes #19860
This commit is contained in:
Daniel Stenberg 2025-12-07 00:03:56 +01:00
parent f4b56f34ba
commit 65597f8fc9
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -211,8 +211,10 @@ bool Curl_check_noproxy(const char *name, const char *no_proxy)
namelen = strlen(name);
if(curlx_inet_pton(AF_INET, name, &address) == 1)
type = TYPE_IPV4;
#ifdef USE_IPV6
else if(curlx_inet_pton(AF_INET6, name, &address) == 1)
type = TYPE_IPV6;
#endif
else {
/* ignore trailing dots in the hostname */
if(name[namelen - 1] == '.')