diff options
author | Daniel Stenberg <daniel@haxx.se> | 2019-09-19 10:19:21 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-09-19 10:19:21 +0200 |
commit | f83d0d32f07b71319f7232e25a599773b89bfb16 (patch) | |
tree | d0d6351b1679f564f224aaaabfd6adb4088598b2 | |
parent | c0d0ae533b48a028b9561233ecff583a72612ec1 (diff) | |
download | curl-f83d0d32f07b71319f7232e25a599773b89bfb16.tar.gz |
urlapi: 'scheme' is always true
-rw-r--r-- | lib/urlapi.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/lib/urlapi.c b/lib/urlapi.c index 7244f4b31..6cec7e4ed 100644 --- a/lib/urlapi.c +++ b/lib/urlapi.c @@ -1075,24 +1075,23 @@ CURLUcode curl_url_get(CURLU *u, CURLUPart what, else return CURLUE_NO_SCHEME; - if(scheme) { - h = Curl_builtin_scheme(scheme); - if(!port && (flags & CURLU_DEFAULT_PORT)) { - /* there's no stored port number, but asked to deliver - a default one for the scheme */ - if(h) { - msnprintf(portbuf, sizeof(portbuf), "%ld", h->defport); - port = portbuf; - } - } - else if(port) { - /* there is a stored port number, but asked to inhibit if it matches - the default one for the scheme */ - if(h && (h->defport == u->portnum) && - (flags & CURLU_NO_DEFAULT_PORT)) - port = NULL; + h = Curl_builtin_scheme(scheme); + if(!port && (flags & CURLU_DEFAULT_PORT)) { + /* there's no stored port number, but asked to deliver + a default one for the scheme */ + if(h) { + msnprintf(portbuf, sizeof(portbuf), "%ld", h->defport); + port = portbuf; } } + else if(port) { + /* there is a stored port number, but asked to inhibit if it matches + the default one for the scheme */ + if(h && (h->defport == u->portnum) && + (flags & CURLU_NO_DEFAULT_PORT)) + port = NULL; + } + if(h && !(h->flags & PROTOPT_URLOPTIONS)) options = NULL; |