shift end_url_with_slash() from http.[ch] to url.[ch]
This allows non-http/curl users to access it too (eg. http-backend.c). Update include headers in end_url_with_slash() users too. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
6cfc028641
commit
1966d9f37b
7
url.c
7
url.c
@ -125,3 +125,10 @@ char *url_decode_parameter_value(const char **query)
|
||||
struct strbuf out = STRBUF_INIT;
|
||||
return url_decode_internal(query, "&", &out, 1);
|
||||
}
|
||||
|
||||
void end_url_with_slash(struct strbuf *buf, const char *url)
|
||||
{
|
||||
strbuf_addstr(buf, url);
|
||||
if (buf->len && buf->buf[buf->len - 1] != '/')
|
||||
strbuf_addstr(buf, "/");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user