From c5955d14cedf015fb2f5e6f25f1c042a075195b8 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 10 Jun 2019 17:22:41 +0200 Subject: [PATCH] chars: speed up the determination of length and width for plain ASCII --- src/chars.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chars.c b/src/chars.c index 18fc92b2..c99206d8 100644 --- a/src/chars.c +++ b/src/chars.c @@ -207,7 +207,7 @@ char control_mbrep(const char *c, bool isdata) int length_of_char(const char *c, int *width) { #ifdef ENABLE_UTF8 - if (use_utf8) { + if (use_utf8 && (signed char)*c < 0) { wchar_t wc; int charlen = mbtowc(&wc, c, MAXCHARLEN);