aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-06-30 11:55:38 -0700
committerJunio C Hamano <gitster@pobox.com>2010-06-30 11:55:38 -0700
commit978327f97dd3bd20f1648a2fcac601191976b18c (patch)
tree857843507a55599a81717b0d6b714e4f7011b1d7
parent6f82be05191a4ec2adcbcac65078f87900ea8741 (diff)
parent3c73a1d57f9319dbbaf882835608ad421c8b9600 (diff)
downloadgit-978327f97dd3bd20f1648a2fcac601191976b18c.tar.gz
git-978327f97dd3bd20f1648a2fcac601191976b18c.tar.xz
Merge branch 'jk/url-decode'
* jk/url-decode: url_decode: URL scheme ends with a colon and does not require a slash
-rw-r--r--url.c8
1 files changed, 4 insertions, 4 deletions
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);
}