]> git.ipfire.org Git - thirdparty/git.git/blobdiff - url.c
shift end_url_with_slash() from http.[ch] to url.[ch]
[thirdparty/git.git] / url.c
diff --git a/url.c b/url.c
index cd8f74f00c345294f94cb25e4e00849a0618168b..7cebc6471b1aea9b001cb44e57a5d0c9a4d8757a 100644 (file)
--- a/url.c
+++ b/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, "/");
+}