author | Jeff King <peff@peff.net> | |
Wed, 23 Feb 2011 09:50:19 +0000 (04:50 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 23 Feb 2011 21:44:36 +0000 (13:44 -0800) | ||
commit | 98acc837a14c2ab1975b38b93cb028e87e47ad4a | |
tree | 81d7357236e35497abebc42a95448d70df20a2fb | tree | snapshot |
parent | 7ed863a85a6ce2c4ac4476848310b8f917ab41f9 | commit | diff |
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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
utf8.c | diff | blob | history | |
utf8.h | diff | blob | history |