From 98acc837a14c2ab1975b38b93cb028e87e47ad4a Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 23 Feb 2011 04:50:19 -0500 Subject: strbuf: add fixed-length version of add_wrapped_text The function strbuf_add_wrapped_text takes a NUL-terminated string. This makes it annoying to wrap strings we have as a pointer and a length. Refactoring strbuf_add_wrapped_text and all of its sub-functions to handle fixed-length strings turned out to be really ugly. So this implementation is lame; it just strdups the text and operates on the NUL-terminated version. This should be fine as the strings we are wrapping are generally pretty short. If it becomes a problem, we can optimize later. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- utf8.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'utf8.h') diff --git a/utf8.h b/utf8.h index ebc4d2fa85..81f2c82fab 100644 --- a/utf8.h +++ b/utf8.h @@ -10,6 +10,8 @@ int is_encoding_utf8(const char *name); int strbuf_add_wrapped_text(struct strbuf *buf, const char *text, int indent, int indent2, int width); +int strbuf_add_wrapped_bytes(struct strbuf *buf, const char *data, int len, + int indent, int indent2, int width); #ifndef NO_ICONV char *reencode_string(const char *in, const char *out_encoding, const char *in_encoding); -- cgit v1.2.3