X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=url.c;h=230623657a0e06975c4721a9fddb117ba84883b1;hb=6baa9bd882fe003478c42ee5709dcfc713e13ec9;hp=bf5bb9c88f751be2dd22bc49bcd9d53812cc5b94;hpb=ba4d01bd74edae1e4adb540a03ba17961f8dd4b2;p=git.git diff --git a/url.c b/url.c index bf5bb9c88..230623657 100644 --- a/url.c +++ b/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); }