diff options
author | Brad King <brad.king@kitware.com> | 2016-12-05 16:50:43 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-12-05 16:50:43 (GMT) |
commit | f8a1ba202f51e70510f12f46fe0633ea908d5144 (patch) | |
tree | fe7f931cdb5c0049cd97660e3888a816dfd4a86f /Utilities/cmcurl/lib/hostcheck.c | |
parent | 25d7b1ca9d3a160850ad1f147ff96ac7c55f7d9f (diff) | |
parent | 93cc249f3dd7ecd621cd063e4c08bbdb54d971e8 (diff) | |
download | CMake-f8a1ba202f51e70510f12f46fe0633ea908d5144.zip CMake-f8a1ba202f51e70510f12f46fe0633ea908d5144.tar.gz CMake-f8a1ba202f51e70510f12f46fe0633ea908d5144.tar.bz2 |
Merge branch 'upstream-curl' into update-curl
* upstream-curl:
curl 2016-11-02 (3c561c65)
Diffstat (limited to 'Utilities/cmcurl/lib/hostcheck.c')
-rw-r--r-- | Utilities/cmcurl/lib/hostcheck.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Utilities/cmcurl/lib/hostcheck.c b/Utilities/cmcurl/lib/hostcheck.c index 4db9e6b..f545254 100644 --- a/Utilities/cmcurl/lib/hostcheck.c +++ b/Utilities/cmcurl/lib/hostcheck.c @@ -30,7 +30,7 @@ #endif #include "hostcheck.h" -#include "rawstr.h" +#include "strcase.h" #include "inet_pton.h" #include "curl_memory.h" @@ -77,7 +77,7 @@ static int hostmatch(char *hostname, char *pattern) pattern_wildcard = strchr(pattern, '*'); if(pattern_wildcard == NULL) - return Curl_raw_equal(pattern, hostname) ? + return strcasecompare(pattern, hostname) ? CURL_HOST_MATCH : CURL_HOST_NOMATCH; /* detect IP address as hostname and fail the match if so */ @@ -94,16 +94,16 @@ static int hostmatch(char *hostname, char *pattern) pattern_label_end = strchr(pattern, '.'); if(pattern_label_end == NULL || strchr(pattern_label_end+1, '.') == NULL || pattern_wildcard > pattern_label_end || - Curl_raw_nequal(pattern, "xn--", 4)) { + strncasecompare(pattern, "xn--", 4)) { wildcard_enabled = 0; } if(!wildcard_enabled) - return Curl_raw_equal(pattern, hostname) ? + return strcasecompare(pattern, hostname) ? CURL_HOST_MATCH : CURL_HOST_NOMATCH; hostname_label_end = strchr(hostname, '.'); if(hostname_label_end == NULL || - !Curl_raw_equal(pattern_label_end, hostname_label_end)) + !strcasecompare(pattern_label_end, hostname_label_end)) return CURL_HOST_NOMATCH; /* The wildcard must match at least one character, so the left-most @@ -114,8 +114,8 @@ static int hostmatch(char *hostname, char *pattern) prefixlen = pattern_wildcard - pattern; suffixlen = pattern_label_end - (pattern_wildcard+1); - return Curl_raw_nequal(pattern, hostname, prefixlen) && - Curl_raw_nequal(pattern_wildcard+1, hostname_label_end - suffixlen, + return strncasecompare(pattern, hostname, prefixlen) && + strncasecompare(pattern_wildcard+1, hostname_label_end - suffixlen, suffixlen) ? CURL_HOST_MATCH : CURL_HOST_NOMATCH; } |