mirror of
https://github.com/tmux/tmux.git
synced 2025-09-04 15:26:58 +00:00
Do not free more lines than are available in the history.
This commit is contained in:
4
grid.c
4
grid.c
@ -292,12 +292,14 @@ grid_collect_history(struct grid *gd)
|
|||||||
{
|
{
|
||||||
u_int ny;
|
u_int ny;
|
||||||
|
|
||||||
if (gd->hsize < gd->hlimit)
|
if (gd->hsize == 0 || gd->hsize < gd->hlimit)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ny = gd->hlimit / 10;
|
ny = gd->hlimit / 10;
|
||||||
if (ny < 1)
|
if (ny < 1)
|
||||||
ny = 1;
|
ny = 1;
|
||||||
|
if (ny > gd->hsize)
|
||||||
|
ny = gd->hsize;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Free the lines from 0 to ny then move the remaining lines over
|
* Free the lines from 0 to ny then move the remaining lines over
|
||||||
|
Reference in New Issue
Block a user