]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Silly mistake - restore-cursor-pos doesn't make sure the cursor zlib-dll
authorSimon Tatham <anakin@pobox.com>
Sat, 8 Jul 2000 16:09:39 +0000 (16:09 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 8 Jul 2000 16:09:39 +0000 (16:09 +0000)
position is inside the screen (it might not be if the screen has
shrunk since the save of cursor position). Thanks to Robert de Bath.

[originally from svn r512]

terminal.c

index 856d5b1953412690469f41dbbc037b8a686cfe09..dc9b2b6ce8e13aaf9e2e9348fc27461ece3a6ea9 100644 (file)
@@ -495,6 +495,9 @@ static void save_cursor(int save) {
     } else {
        curs_x = save_x;
        curs_y = save_y;
+       /* Make sure the window hasn't shrunk since the save */
+       if (curs_x >= cols) curs_x = cols-1;
+       if (curs_y >= rows) curs_y = rows-1;
        curr_attr = save_attr;
        cset = save_cset;
        cset_attr[cset] = save_csattr;