Fix vttest "Funny scrolling regions" by ignoring some invalid scroll regions

Addresses #155 github issue.
This commit is contained in:
Keith Winstein
2012-04-14 01:11:57 -04:00
parent 45487f6623
commit 53f79e4261
+6
View File
@@ -316,6 +316,12 @@ void CSI_DECSTBM( Framebuffer *fb, Dispatcher *dispatch )
int top = dispatch->getparam( 0, 1 ); int top = dispatch->getparam( 0, 1 );
int bottom = dispatch->getparam( 1, fb->ds.get_height() ); int bottom = dispatch->getparam( 1, fb->ds.get_height() );
if ( (bottom <= top)
|| (top > fb->ds.get_height())
|| (top == 0 && bottom == 1) ) {
return; /* invalid, xterm ignores */
}
fb->ds.set_scrolling_region( top - 1, bottom - 1 ); fb->ds.set_scrolling_region( top - 1, bottom - 1 );
fb->ds.move_row( 0 ); fb->ds.move_row( 0 );
fb->ds.move_col( 0 ); fb->ds.move_col( 0 );