Skip to content

Commit 978327f

Browse files
committed
Merge branch 'jk/url-decode'
* jk/url-decode: url_decode: URL scheme ends with a colon and does not require a slash
2 parents 6f82be0 + 3c73a1d commit 978327f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

url.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@ static char *url_decode_internal(const char **query, const char *stop_at, struct
103103
char *url_decode(const char *url)
104104
{
105105
struct strbuf out = STRBUF_INIT;
106-
const char *slash = strchr(url, '/');
106+
const char *colon = strchr(url, ':');
107107

108108
/* Skip protocol part if present */
109-
if (slash && url < slash) {
110-
strbuf_add(&out, url, slash - url);
111-
url = slash;
109+
if (colon && url < colon) {
110+
strbuf_add(&out, url, colon - url);
111+
url = colon;
112112
}
113113
return url_decode_internal(&url, NULL, &out);
114114
}

0 commit comments

Comments
 (0)