summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1966d9f)
raw | patch | inline | side by side (parent: 1966d9f)
author | Tay Ray Chuan <rctay89@gmail.com> | |
Thu, 25 Nov 2010 08:21:05 +0000 (16:21 +0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 26 Nov 2010 22:50:45 +0000 (14:50 -0800) |
Helped-by: Johnathan Nieder <jrnieder@gmail.com>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
url.c | patch | blob | history | |
url.h | patch | blob | history |
index 7cebc6471b1aea9b001cb44e57a5d0c9a4d8757a..6a5495960f03ded65f0f5f8b8bd5c7cd98c0b05e 100644 (file)
--- a/url.c
+++ b/url.c
if (buf->len && buf->buf[buf->len - 1] != '/')
strbuf_addstr(buf, "/");
}
+
+void str_end_url_with_slash(const char *url, char **dest) {
+ struct strbuf buf = STRBUF_INIT;
+ end_url_with_slash(&buf, url);
+ free(*dest);
+ *dest = strbuf_detach(&buf, NULL);
+}
index 8cb74d4a0a8b30afcbf03650cd511cad27e8e4d1..7100e3215a97b234c8ab93b76f7f86518f7c3382 100644 (file)
--- a/url.h
+++ b/url.h
extern char *url_decode_parameter_value(const char **query);
extern void end_url_with_slash(struct strbuf *buf, const char *url);
+extern void str_end_url_with_slash(const char *url, char **dest);
#endif /* URL_H */