submodule: port init from shell to C
[gitweb.git] / url.c
diff --git a/url.c b/url.c
index 335d97d3f74e5b7d7139e223fbe1d19837a72e81..2d89ad190cfe1c57cd20194661329551ff229993 100644 (file)
--- a/url.c
+++ b/url.c
@@ -120,8 +120,7 @@ char *url_decode_parameter_value(const char **query)
 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, "/");
+       strbuf_complete(buf, '/');
 }
 
 void str_end_url_with_slash(const char *url, char **dest) {