core: fix spaces displayed after combining chars (bug #40115)

This commit is contained in:
Sebastien Helleu 2013-10-02 08:03:22 +02:00
parent 4e67133b9e
commit 42dce54812

View File

@ -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