summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-10-20 21:57:05 -0400
committerJesse Luehrs <doy@tozt.net>2014-10-20 21:57:05 -0400
commit51eef0b615bc7a540d29ab7fc42906fd77ee9807 (patch)
tree4afed766d174e3d13396b6172dd640d34447901d
parent90dfce0d3edc92287ce1519dafc7e91ba70c1368 (diff)
downloadlibvt100-51eef0b615bc7a540d29ab7fc42906fd77ee9807.tar.gz
libvt100-51eef0b615bc7a540d29ab7fc42906fd77ee9807.zip
also update parser.c
-rw-r--r--src/parser.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/parser.c b/src/parser.c
index 41f66df..94406ea 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -2584,6 +2584,14 @@ static void vt100_parser_handle_cup(VT100Screen *vt, char *buf, size_t len)
if (params[1] == 0) {
params[1] = 1;
}
+ /* this needs to be fixed up here (and not in screen.c) because CUP hsould
+ * never cause scrolling */
+ if (params[0] > vt->grid->max.row) {
+ params[0] = vt->grid->max.row;
+ }
+ if (params[1] > vt->grid->max.col) {
+ params[1] = vt->grid->max.col;
+ }
vt100_screen_move_to(vt, params[0] - 1, params[1] - 1);
}