Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Aug 2001 13:34:48 +0200 (CEST)
From:      Nils M Holm <nmh@t3x.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/29601: Re: doscmd INT 10, FNs 0x09,0x0A cause wrong output
Message-ID:  <Pine.BSF.4.21.0108101331390.881-100000@Oxygen2.UUCP>
In-Reply-To: <Pine.BSF.4.21.0108091915070.1900-100000@Oxygen2.UUCP>

next in thread | previous in thread | raw e-mail | index | archive | help

>Number:         29601
>Category:       bin
>Synopsis:       doscmd INT 10, FNs 0x09,0x0A cause wrong output
>Confidential:   yes
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 10 04:40:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Nils M Holm
>Release:        FreeBSD 4.2-RELEASE i386
>Organization:
>Environment:
>Description:

Sorry, my original fix had a side effect and is unusable.
Here is an improved one.

>How-To-Repeat:
>Fix:

--- /usr/src/usr.bin/doscmd/doscmd.h.org	Fri Aug 10 13:28:30 2001
+++ /usr/src/usr.bin/doscmd/doscmd.h	Fri Aug 10 13:26:09 2001
@@ -278,7 +278,7 @@
 void tty_move(int, int);
 void tty_report(int *, int *);
 void tty_flush();
-void tty_index();
+void tty_index(int);
 void tty_pause();
 int tty_peek(REGISTERS, int);
 int tty_state();
--- /usr/src/usr.bin/doscmd/tty.c.org	Thu Aug  9 19:03:25 2001
+++ /usr/src/usr.bin/doscmd/tty.c	Fri Aug 10 13:25:35 2001
@@ -1586,7 +1586,7 @@
 }
 
 void
-tty_index()
+tty_index(int scroll)
 {
 	int i;
 
@@ -1594,9 +1594,11 @@
 		row = 0;
 	else if (++row >= height) {
 		row = height - 1;
-		memcpy(vmem, &vmem[width], 2 * width * (height - 1));
-		for (i = 0; i < width; ++i)
-		    vmem[(height - 1) * width + i] = vattr | ' ';
+		if (scroll) {
+			memcpy(vmem, &vmem[width], 2 * width * (height - 1));
+			for (i = 0; i < width; ++i)
+				vmem[(height - 1) * width + i] = vattr | ' ';
+		}
 	}
 	SetVREGCur();
 }
@@ -1639,19 +1641,19 @@
 		col = (col + 8) & ~0x07;
 		if (col > width) {
 			col = 0;
-			tty_index();
+			tty_index(1);
 		}
 		break;
 	case '\r':
 		col = 0;
 		break;
 	case '\n':
-		tty_index();
+		tty_index(1);
 		break;
 	default:
 		if (col >= width) {
 			col = 0;
-			tty_index();
+			tty_index(1);
 		}
 		if (row > (height - 1))
 			row = 0;
@@ -1676,7 +1678,7 @@
 	while (n--) {
 		if (col >= width) {
 			col = 0;
-			tty_index();
+			tty_index(0);
 		}
 		if (row > (height - 1))
 			row = 0;


>Release-Note:
>Audit-Trail:
>Unformatted:
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0108101331390.881-100000>