diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-01-11 02:04:22 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-01-11 02:04:23 +0400 |
commit | 74474a94f217a0499cc23346d8d094893fb46257 (patch) | |
tree | b3c061af3a9ee948ddd7d2fb28dedafd72765917 /utf8.c | |
parent | 2601298f43a9375ae996b4b3c9afeeb29ba5d597 (diff) | |
parent | e0db1765c3bb108b55ebf82b4e5962f9d1f5e5b7 (diff) |
Merge branch 'sp/shortlog-missing-lf' into maint
* sp/shortlog-missing-lf:
strbuf_add_wrapped*(): Remove unused return value
shortlog: fix wrapping lines of wraplen
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -323,7 +323,7 @@ static size_t display_mode_esc_sequence_len(const char *s) * If indent is negative, assume that already -indent columns have been * consumed (and no extra indent is necessary for the first line). */ -int strbuf_add_wrapped_text(struct strbuf *buf, +void strbuf_add_wrapped_text(struct strbuf *buf, const char *text, int indent1, int indent2, int width) { int indent, w, assume_utf8 = 1; @@ -332,7 +332,7 @@ int strbuf_add_wrapped_text(struct strbuf *buf, if (width <= 0) { strbuf_add_indented_text(buf, text, indent1, indent2); - return 1; + return; } retry: @@ -356,14 +356,14 @@ retry: if (w <= width || !space) { const char *start = bol; if (!c && text == start) - return w; + return; if (space) start = space; else strbuf_addchars(buf, ' ', indent); strbuf_add(buf, start, text - start); if (!c) - return w; + return; space = text; if (c == '\t') w |= 0x07; @@ -405,13 +405,12 @@ new_line: } } -int strbuf_add_wrapped_bytes(struct strbuf *buf, const char *data, int len, +void strbuf_add_wrapped_bytes(struct strbuf *buf, const char *data, int len, int indent, int indent2, int width) { char *tmp = xstrndup(data, len); - int r = strbuf_add_wrapped_text(buf, tmp, indent, indent2, width); + strbuf_add_wrapped_text(buf, tmp, indent, indent2, width); free(tmp); - return r; } int is_encoding_utf8(const char *name) |