mirror of
https://github.com/git/git.git
synced 2024-11-27 12:03:55 +08:00
url_decode: URL scheme ends with a colon and does not require a slash
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
ce83eda155
commit
3c73a1d57f
8
url.c
8
url.c
@ -103,12 +103,12 @@ static char *url_decode_internal(const char **query, const char *stop_at, struct
|
||||
char *url_decode(const char *url)
|
||||
{
|
||||
struct strbuf out = STRBUF_INIT;
|
||||
const char *slash = strchr(url, '/');
|
||||
const char *colon = strchr(url, ':');
|
||||
|
||||
/* Skip protocol part if present */
|
||||
if (slash && url < slash) {
|
||||
strbuf_add(&out, url, slash - url);
|
||||
url = slash;
|
||||
if (colon && url < colon) {
|
||||
strbuf_add(&out, url, colon - url);
|
||||
url = colon;
|
||||
}
|
||||
return url_decode_internal(&url, NULL, &out);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user