Git development
 help / color / mirror / Atom feed
* [PATCH 0/2] utf8: two minor fixes
@ 2026-11-16 18:56 Dirk Gouders
  2026-11-16 18:57 ` [PATCH 1/2] utf8: respect bounds in utf8_strnwidth() Dirk Gouders
  2026-11-16 18:57 ` [PATCH 2/2] utf8: fix comment for utf8_strnwidth() Dirk Gouders
  0 siblings, 2 replies; 8+ messages in thread
From: Dirk Gouders @ 2026-11-16 18:56 UTC (permalink / raw)
  To: git; +Cc: Dirk Gouders

A patch here on the list made me look at
display_mode_esc_sequence_len() in utf8.c and I found two details in
the file that are perhaps worth a fix:

1) utf8_strnwidth() disregards the given len argument when fed
   with proper string and len.

2) The comment for utf8_strnwidth() is incorrect: it states the
   function returns strlen() for cases when it actually returns its
   len argument.

Signed-off-by: Dirk Gouders <dirk@gouders.net>
---
Dirk Gouders (2):
      utf8: respect bounds in utf8_strnwidth()
      utf8: fix comment for utf8_strnwidth()

 t/unit-tests/u-utf8-width.c | 11 +++++++++++
 utf8.c                      | 12 ++++++++----
 2 files changed, 19 insertions(+), 4 deletions(-)


---
base-commit: 7fb6055e678f800320d8ab8cd8f201d9493d1ba0
change-id: 20261116-master-69b171612823


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-11-17 18:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16 18:56 [PATCH 0/2] utf8: two minor fixes Dirk Gouders
2026-11-16 18:57 ` [PATCH 1/2] utf8: respect bounds in utf8_strnwidth() Dirk Gouders
2026-11-17  0:02   ` Junio C Hamano
2026-11-17 15:15     ` Dirk Gouders
2026-11-17 16:18     ` Junio C Hamano
2026-11-17 17:57       ` Dirk Gouders
2026-11-17 18:11         ` Junio C Hamano
2026-11-16 18:57 ` [PATCH 2/2] utf8: fix comment for utf8_strnwidth() Dirk Gouders

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox