From 40437cf54922452d5d8ada8799fbc5e9858f5a3e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 13 Apr 1998 06:42:31 +0000 Subject: [PATCH] (dosv_refresh_virtual_screen): Do not use negative arguments. (dos_direct_output): Fix the offset passed to dosv_refresh_virtual_screen. (IT_display_cursor): Don't call dosv_refresh_virtual_screen. (IT_reset_terminal_modes): Don't call dosv_refresh_virtual_screen when setting cursor. --- src/msdos.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/msdos.c b/src/msdos.c index 113dba6abbd..cde3949564f 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -325,6 +325,9 @@ dosv_refresh_virtual_screen (int offset, int count) { __dpmi_regs regs; + if (offset < 0 || count < 0) /* paranoia; illegal values crash DOS/V */ + return; + regs.h.ah = 0xff; /* update relocated screen */ regs.x.es = screen_virtual_segment; regs.x.di = screen_virtual_offset + offset; @@ -340,8 +343,8 @@ dos_direct_output (y, x, buf, len) char *buf; int len; { - int t = (int) ScreenPrimary + 2 * (x + y * screen_size_X); - int t0 = t; + int t0 = 2 * (x + y * screen_size_X); + int t = t0 + (int) ScreenPrimary; int l0 = len; #if (__DJGPP__ < 2) @@ -741,8 +744,6 @@ IT_display_cursor (int on) ScreenSetCursor (-1, -1); cursor_cleared = 1; } - if (screen_virtual_segment) - dosv_refresh_virtual_screen (2 * (current_pos_X + screen_size_X * current_pos_Y), 1); } /* Emacs calls cursor-movement functions a lot when it updates the @@ -975,9 +976,6 @@ IT_reset_terminal_modes (void) cursor_pos_Y = startup_pos_Y; ScreenSetCursor (cursor_pos_Y, cursor_pos_X); - if (screen_virtual_segment) - dosv_refresh_virtual_screen (2*(cursor_pos_X+cursor_pos_Y*screen_size_X), - 1); xfree (startup_screen_buffer); term_setup_done = 0; -- 2.39.2