summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Satiro <raysatiro@yahoo.com>2020-01-27 14:52:02 -0500
committerJay Satiro <raysatiro@yahoo.com>2020-01-27 14:52:02 -0500
commit5f171e17e351047a26136735e152f7911c9930ab (patch)
tree6107dbfaaef129d7b21d73ea84772d98ff53fa15
parent3dc16d6e96f569311fbc9b531d7017dce913c891 (diff)
downloadcurl-bagder/urlparse-credentials-no-scheme.tar.gz
squashme: change schemep to constbagder/urlparse-credentials-no-scheme
-rw-r--r--lib/urlapi.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/urlapi.c b/lib/urlapi.c
index c2201f2bf..506e244dc 100644
--- a/lib/urlapi.c
+++ b/lib/urlapi.c
@@ -575,7 +575,7 @@ UNITTEST CURLUcode Curl_parse_port(struct Curl_URL *u, char *hostname)
}
/* scan for byte values < 31 or 127 */
-static CURLUcode junkscan(char *part)
+static CURLUcode junkscan(const char *part)
{
if(part) {
static const char badbytes[]={
@@ -672,7 +672,7 @@ static CURLUcode seturl(const char *url, CURLU *u, unsigned int flags)
CURLUcode result;
bool url_has_scheme = FALSE;
char schemebuf[MAX_SCHEME_LEN + 1];
- char *schemep = NULL;
+ const char *schemep = NULL;
size_t schemelen = 0;
size_t urllen;
@@ -801,7 +801,7 @@ static CURLUcode seturl(const char *url, CURLU *u, unsigned int flags)
if(!(flags & (CURLU_DEFAULT_SCHEME|CURLU_GUESS_SCHEME)))
return CURLUE_MALFORMED_INPUT;
if(flags & CURLU_DEFAULT_SCHEME)
- schemep = (char *) DEFAULT_SCHEME;
+ schemep = DEFAULT_SCHEME;
/*
* The URL was badly formatted, let's try without scheme specified.
@@ -924,19 +924,19 @@ static CURLUcode seturl(const char *url, CURLU *u, unsigned int flags)
if((flags & CURLU_GUESS_SCHEME) && !schemep) {
/* legacy curl-style guess based on host name */
if(checkprefix("ftp.", hostname))
- schemep = (char *)"ftp";
+ schemep = "ftp";
else if(checkprefix("dict.", hostname))
- schemep = (char *)"dict";
+ schemep = "dict";
else if(checkprefix("ldap.", hostname))
- schemep = (char *)"ldap";
+ schemep = "ldap";
else if(checkprefix("imap.", hostname))
- schemep = (char *)"imap";
+ schemep = "imap";
else if(checkprefix("smtp.", hostname))
- schemep = (char *)"smtp";
+ schemep = "smtp";
else if(checkprefix("pop3.", hostname))
- schemep = (char *)"pop3";
+ schemep = "pop3";
else
- schemep = (char *)"http";
+ schemep = "http";
u->scheme = strdup(schemep);
if(!u->scheme)