X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=url.c;h=230623657a0e06975c4721a9fddb117ba84883b1;hb=48c250a121a425a1860226b6a7061aecfbab5246;hp=bf5bb9c88f751be2dd22bc49bcd9d53812cc5b94;hpb=f526d120f649ec4426b559e94e09655b5a4f2b87;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); }