wrap code - line2 COULD be NULL technically, so handle that case

This commit is contained in:
Carsten Haitzler 2013-12-06 19:00:23 +09:00
parent 05d091483a
commit 6cbc4c1a09
1 changed files with 12 additions and 9 deletions

View File

@ -639,7 +639,7 @@ termpty_line_rewrap(Termpty *ty, int y_start, int y_end,
int x, x2, y, y2, y2_start;
int len, len_last, len_remaining, copy_width, ts2_width;
Termsave *ts, *ts2;
Termcell *line, *line2;
Termcell *line, *line2 = NULL;
if (y_end >= 0)
{
@ -714,6 +714,8 @@ termpty_line_rewrap(Termpty *ty, int y_start, int y_end,
back2[y2 + ty->backmax] = ts2;
}
}
if (line2)
{
termpty_cell_copy(ty, line + x, line2 + x2, copy_width);
x += copy_width;
x2 += copy_width;
@ -725,6 +727,7 @@ termpty_line_rewrap(Termpty *ty, int y_start, int y_end,
y2++;
}
}
}
x = 0;
y++;
}