From nmh@t3x.org  Fri Aug 10 04:32:05 2001
Return-Path: <nmh@t3x.org>
Received: from mout0.freenet.de (mout0.freenet.de [194.97.50.131])
	by hub.freebsd.org (Postfix) with ESMTP id B6D9037B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 10 Aug 2001 04:32:05 -0700 (PDT)
	(envelope-from nmh@t3x.org)
Received: from [194.97.50.144] (helo=mx1.freenet.de)
	by mout0.freenet.de with esmtp (Exim 3.32 #1)
	id 15VAWK-0005th-00
	for FreeBSD-gnats-submit@freebsd.org; Fri, 10 Aug 2001 13:32:04 +0200
Received: from b85aa.pppool.de ([213.7.133.170])
	by mx1.freenet.de with esmtp (Exim 3.32 #1)
	id 15VAWK-0006If-00
	for FreeBSD-gnats-submit@freebsd.org; Fri, 10 Aug 2001 13:32:04 +0200
Message-Id: <Pine.BSF.4.21.0108101331390.881-100000@Oxygen2.UUCP>
Date: Fri, 10 Aug 2001 13:34:48 +0200 (CEST)
From: Nils M Holm <nmh@t3x.org>
Reply-To: nmh@t3x.org
To: FreeBSD-gnats-submit@freebsd.org
In-Reply-To: <Pine.BSF.4.21.0108091915070.1900-100000@Oxygen2.UUCP>
Subject: Re: doscmd INT 10, FNs 0x09,0x0A cause wrong output

>Number:         29601
>Category:       bin
>Synopsis:       doscmd INT 10, FNs 0x09,0x0A cause wrong output
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 10 04:40:01 PDT 2001
>Closed-Date:    Tue Aug 14 04:58:14 PDT 2001
>Last-Modified:  Tue Nov 27 18:35:59 PST 2001
>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:
State-Changed-From-To: open->closed 
State-Changed-By: tg 
State-Changed-When: Tue Aug 14 04:58:14 PDT 2001 
State-Changed-Why:  
Committed, thanks. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=29601 
>Unformatted:
 
