Fix crash caused if a unicode combing character is sent before any text
This commit is contained in:
parent
4098b33bb7
commit
27a1f27e59
@ -320,6 +320,7 @@ width(Line *self, PyObject *val) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
line_add_combining_char(Line *self, uint32_t ch, unsigned int x) {
|
line_add_combining_char(Line *self, uint32_t ch, unsigned int x) {
|
||||||
|
if (!self->cells[x].ch) return; // dont allow adding combining chars to a null cell
|
||||||
combining_type c = self->cells[x].cc;
|
combining_type c = self->cells[x].cc;
|
||||||
if (c & CC_MASK) self->cells[x].cc = (c & CC_MASK) | ( (ch & CC_MASK) << CC_SHIFT );
|
if (c & CC_MASK) self->cells[x].cc = (c & CC_MASK) | ( (ch & CC_MASK) << CC_SHIFT );
|
||||||
else self->cells[x].cc = ch & CC_MASK;
|
else self->cells[x].cc = ch & CC_MASK;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user