From 42dce548129441feb5850fc6d304a56d436e2615 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Wed, 2 Oct 2013 08:03:22 +0200 Subject: [PATCH] core: fix spaces displayed after combining chars (bug #40115) --- src/core/wee-utf8.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/wee-utf8.c b/src/core/wee-utf8.c index 6b193829c..6d65708ac 100644 --- a/src/core/wee-utf8.c +++ b/src/core/wee-utf8.c @@ -427,10 +427,11 @@ utf8_strlen_screen (const char *string) { length = wcswidth (ptr_wstring, num_char); /* - * ensure the size is always >= 1, to prevent any display bug - * (for example size of UTF-8 char U+26C4 is -1, why? mystery...) + * if the char is non-printable, wcswidth returns -1 + * (for example the length of the snowman without snow (U+26C4) == -1) + * => in this case, consider the length is 1, to prevent any display bug */ - if (length < 1) + if (length < 0) length = 1; } else