From: Junio C Hamano Date: Thu, 24 Jun 2010 20:36:30 +0000 (-0700) Subject: url_decode: URL scheme ends with a colon and does not require a slash X-Git-Tag: v1.7.2-rc1~6^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3c73a1d57f9319dbbaf882835608ad421c8b9600;p=git.git url_decode: URL scheme ends with a colon and does not require a slash Signed-off-by: Junio C Hamano --- 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); }