Skip to content

Commit

Permalink
Merge branch 'jk/url-decode'
Browse files Browse the repository at this point in the history
* jk/url-decode:
  url_decode: URL scheme ends with a colon and does not require a slash
  • Loading branch information
Junio C Hamano committed Jun 30, 2010
2 parents 6f82be0 + 3c73a1d commit 978327f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions url.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 978327f

Please sign in to comment.