urlapi: skip path checks if path is just "/"
As a miniscule optimization, treat a path of the length 1 as the same as non-existing, as it can only be a single leading slash, and that's what we do for no paths as well. Closes #10385
This commit is contained in:
parent
92d4053afd
commit
804d5293f8
@ -1200,9 +1200,10 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags)
|
|||||||
path = u->path = Curl_dyn_ptr(&enc);
|
path = u->path = Curl_dyn_ptr(&enc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!pathlen) {
|
if(pathlen <= 1) {
|
||||||
/* there is no path left, unset */
|
/* there is no path left or just the slash, unset */
|
||||||
path = NULL;
|
path = NULL;
|
||||||
|
pathlen = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(!u->path) {
|
if(!u->path) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user