urlapi: take const args in _dup and _get functions

Closes #10708
This commit is contained in:
rcombs 2023-03-08 02:18:39 -06:00 committed by Daniel Stenberg
parent 95cb7d3166
commit b1d735956f
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 5 additions and 5 deletions

View File

@ -117,14 +117,14 @@ CURL_EXTERN void curl_url_cleanup(CURLU *handle);
* curl_url_dup() duplicates a CURLU handle and returns a new copy. The new
* handle must also be freed with curl_url_cleanup().
*/
CURL_EXTERN CURLU *curl_url_dup(CURLU *in);
CURL_EXTERN CURLU *curl_url_dup(const CURLU *in);
/*
* curl_url_get() extracts a specific part of the URL from a CURLU
* handle. Returns error code. The returned pointer MUST be freed with
* curl_free() afterwards.
*/
CURL_EXTERN CURLUcode curl_url_get(CURLU *handle, CURLUPart what,
CURL_EXTERN CURLUcode curl_url_get(const CURLU *handle, CURLUPart what,
char **part, unsigned int flags);
/*

View File

@ -1350,7 +1350,7 @@ void curl_url_cleanup(CURLU *u)
} \
} while(0)
CURLU *curl_url_dup(CURLU *in)
CURLU *curl_url_dup(const CURLU *in)
{
struct Curl_URL *u = calloc(sizeof(struct Curl_URL), 1);
if(u) {
@ -1371,10 +1371,10 @@ CURLU *curl_url_dup(CURLU *in)
return NULL;
}
CURLUcode curl_url_get(CURLU *u, CURLUPart what,
CURLUcode curl_url_get(const CURLU *u, CURLUPart what,
char **part, unsigned int flags)
{
char *ptr;
const char *ptr;
CURLUcode ifmissing = CURLUE_UNKNOWN_PART;
char portbuf[7];
bool urldecode = (flags & CURLU_URLDECODE)?1:0;