Thread View: linux.kernel.git
1 messages
1 total messages
Started by Junio C Hamano
Wed, 25 Nov 2026 19:40
Re: [PATCH v6 0/4] utf8: bounds-related fixes and a doc fix
Author: Junio C Hamano
Date: Wed, 25 Nov 2026 19:40
Date: Wed, 25 Nov 2026 19:40
31 lines
13770 bytes
13770 bytes
Dirk Gouders <dirk@gouders.net> writes:
> • Don't use the _counted variant in strbuf_add_wrapped_text() where
> a NUL terminator is the string's boundary.
> Reword the commit message, accordingly.
;-)
> -@@ utf8.c: void strbuf_add_wrapped_text(struct strbuf *buf,
> - {
> - int indent, w, assume_utf8 = 1;
> - const char *bol, *space, *start = text;
> -+ const char *end = text + strlen(text);
> - size_t orig_len = buf->len;
> -
> - if (width <= 0) {
> -@@ utf8.c: void strbuf_add_wrapped_text(struct strbuf *buf,
> - char c;
> - size_t skip;
> -
> -- while ((skip = display_mode_esc_sequence_len(text)))
> -+ while ((skip = display_mode_esc_sequence_len_counted(text,
> -+ end - text)))
> - text += skip;
This update is really nice. We do not need to measure strlen(text) and
instead let the display_mode_esc_sequence_len() take care of it cheaply
by passing SIZE_MAX.
All looks good. Will replace. Thanks.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads