From a1fd084d192d2a0993e0d0c725adc63c079505ae Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 5 Oct 2026 08:32:24 +0000 Subject: [PATCH] Adjust widths of a few codepoints incorrectly set to double width, from Sidney Cammeresi. --- utf8-combined.c | 8 +++++++- utf8.c | 6 +----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/utf8-combined.c b/utf8-combined.c index 02abc3518..78a34074d 100644 --- a/utf8-combined.c +++ b/utf8-combined.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utf8-combined.c,v 1.10 2026/06/09 11:49:36 nicm Exp $ */ +/* $OpenBSD: utf8-combined.c,v 1.11 2026/10/05 08:32:24 nicm Exp $ */ /* * Copyright (c) 2023 Nicholas Marriott @@ -121,6 +121,12 @@ utf8_should_combine(const struct utf8_data *with, const struct utf8_data *add) /* Emoji skin tone modifiers. */ switch (a) { + case 0x0261D: + case 0x026F9: + case 0x0270A: + case 0x0270B: + case 0x0270C: + case 0x0270D: case 0x1F44B: case 0x1F44C: case 0x1F44D: diff --git a/utf8.c b/utf8.c index c36b4e4b2..569b5c02a 100644 --- a/utf8.c +++ b/utf8.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utf8.c,v 1.73 2026/09/20 08:11:00 nicm Exp $ */ +/* $OpenBSD: utf8.c,v 1.74 2026/10/05 08:32:24 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -50,12 +50,8 @@ static struct utf8_width_cache utf8_width_cache = RB_INITIALIZER(utf8_width_cache); static struct utf8_width_item utf8_default_width_cache[] = { - { .wc = 0x0261D, .width = 2 }, - { .wc = 0x026F9, .width = 2 }, { .wc = 0x0270A, .width = 2 }, { .wc = 0x0270B, .width = 2 }, - { .wc = 0x0270C, .width = 2 }, - { .wc = 0x0270D, .width = 2 }, { .wc = 0x1F1E6, .width = 1 }, { .wc = 0x1F1E7, .width = 1 }, { .wc = 0x1F1E8, .width = 1 },