mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
Fix crash on ESC#6 + combining chars + GTK + odd-width terminal.
When we're displaying double-width text as a result of the VT100 ESC#6 escape sequence or its friends, and the terminal width is an odd number of columns, we divide by 2 the number of characters we'll even try to display, and round _down_: if there's a rightmost odd column, it stays blank, and doesn't show the left half of a double-width char. In the GTK redraw function, that rounding-down can set the 'len' variable to zero. But when we're displaying a character with Unicode combining chars on top, that fails an assertion that len == 1, because at the top of the function we set it to 1. The fix is just to return early if len is reduced to zero by that rounding: if we're not displaying any characters, then we don't have to do anything at all.
This commit is contained in:
parent
3edc1b330d
commit
daf91ef8ae
@ -3769,8 +3769,11 @@ static void do_text_internal(
|
||||
x *= 2;
|
||||
if (x >= inst->term->cols)
|
||||
return;
|
||||
if (x + len*2*widefactor > inst->term->cols)
|
||||
if (x + len*2*widefactor > inst->term->cols) {
|
||||
len = (inst->term->cols-x)/2/widefactor;/* trim to LH half */
|
||||
if (len == 0)
|
||||
return; /* rounded down half a double-width char to zero */
|
||||
}
|
||||
rlen = len * 2;
|
||||
} else
|
||||
rlen = len;
|
||||
|
Loading…
Reference in New Issue
Block a user