mirror of
https://github.com/tmux/tmux.git
synced 2025-01-07 16:28:48 +00:00
Increment the lines counter when skipping a line to avoid an infinite
loop, and fix a check to avoid a potential out-of-bounds access. Problem reported by Yuxiang Qin and tracked down by Karl Beldan; GitHub issue 1352. Also a man page fix request by jmc@.
This commit is contained in:
parent
d1f5142dab
commit
ba31d3a88c
3
grid.c
3
grid.c
@ -1011,7 +1011,7 @@ grid_reflow_join(struct grid *target, struct grid *gd, u_int sx, u_int yy,
|
|||||||
* If this is now the last line, there is nothing more to be
|
* If this is now the last line, there is nothing more to be
|
||||||
* done.
|
* done.
|
||||||
*/
|
*/
|
||||||
if (yy + lines == gd->hsize + gd->sy)
|
if (yy + 1 + lines == gd->hsize + gd->sy)
|
||||||
break;
|
break;
|
||||||
line = yy + 1 + lines;
|
line = yy + 1 + lines;
|
||||||
|
|
||||||
@ -1021,6 +1021,7 @@ grid_reflow_join(struct grid *target, struct grid *gd, u_int sx, u_int yy,
|
|||||||
if (gd->linedata[line].cellused == 0) {
|
if (gd->linedata[line].cellused == 0) {
|
||||||
if (!wrapped)
|
if (!wrapped)
|
||||||
break;
|
break;
|
||||||
|
lines++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
tmux.1
3
tmux.1
@ -3585,7 +3585,8 @@ and
|
|||||||
.Ql #} ,
|
.Ql #} ,
|
||||||
unless they are part of a
|
unless they are part of a
|
||||||
.Ql #{...}
|
.Ql #{...}
|
||||||
replacement. For example:
|
replacement.
|
||||||
|
For example:
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
#{?pane_in_mode,#[fg=white#,bg=red],#[fg=red#,bg=white]}#W .
|
#{?pane_in_mode,#[fg=white#,bg=red],#[fg=red#,bg=white]}#W .
|
||||||
.Ed
|
.Ed
|
||||||
|
Loading…
Reference in New Issue
Block a user