From ernie!bert.kts.org!hm@ppp.net Sun Sep 26 05:02:05 1999
Return-Path: <ernie!bert.kts.org!hm@ppp.net>
Received: from mail.ppp.net (mail.ppp.net [194.64.12.35])
	by hub.freebsd.org (Postfix) with ESMTP id E69C315339
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 26 Sep 1999 05:02:03 -0700 (PDT)
	(envelope-from ernie!bert.kts.org!hm@ppp.net)
Received: from casparc.ppp.net (casparc2.ppp.net [194.64.12.42])
	by mail.ppp.net (8.8.8/8.8.8) with SMTP id OAA02579
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 26 Sep 1999 14:02:02 +0200
Received: from ernie by casparc.ppp.net with uucp
	(Smail3.1.28.1 #1) id m11VD0D-002ZjZC; Sun, 26 Sep 99 13:02 MET
Received: from bert.kts.org([194.55.156.2]) (2829 bytes) by ernie.kts.org
	via sendmail with P:smtp/R:smart_host/T:uux
	(sender: <hm@bert.kts.org>) 
	id <m11VCdc-0006SvC@ernie.kts.org>
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 26 Sep 1999 13:38:40 +0200 (CEST)
	(Smail-3.2.0.103 1998-Oct-9 #5 built 1999-Apr-19)
Received: from localhost (2331 bytes) by bert.kts.org
	via sendmail with P:stdio/R:smart_host/T:smtp
	(sender: <hm>) (ident <hm> using unix)
	id <m11VCjC-00002wC@bert.kts.org>
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 26 Sep 1999 13:44:26 +0200 (CEST)
	(Smail-3.2.0.103 1998-Oct-9 #4 built 1998-Dec-26)
Message-Id: <m11VCjC-00002wC@bert.kts.org>
Date: Sun, 26 Sep 1999 13:44:26 +0200 (CEST)
From: hm@kts.org
Sender: ernie!bert.kts.org!hm@ppp.net
Reply-To: hm@kts.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: (n)curses bug in FreeBSD-current
X-Send-Pr-Version: 3.2

>Number:         13978
>Category:       kern
>Synopsis:       a write to last column bug appears since ncurses conversion
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    rafan
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 26 11:10:01 PDT 1999
>Closed-Date:    Sat Apr 28 15:09:42 GMT 2007
>Last-Modified:  Sat Apr 28 15:09:42 GMT 2007
>Originator:     Hellmuth Michaelis
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
Kitchen Table Systems
>Environment:
	
	FreeBSD ernie.kts.org 3.2-STABLE FreeBSD 3.2-STABLE #5: Thu Sep 16 16:44:33 CEST 1999

	and

	FreeBSD bert.kts.org 4.0-CURRENT FreeBSD 4.0-CURRENT #0: Sat Sep 25 15:53:18 CEST 1999

>Description:

	In contrast to FreeBSD 3.2-Stable, it is no longer possible in a 
	curses window (with scrollok enabled - if that matters) to write
	to the last column without causing a newline to occur.

	Running the program below compiled on 3.2 displaying in an xterm
	on a 4.0 machine gives one output line beneath the other without
	blank lines between output lines.

	Running the same program compiled on 4.0 displaying in the same
	xterm on a 4.0 machine gives a blank line after each line of output
	from the program.


>How-To-Repeat:

	Compile the program on a 3.2-stable system and on a 4.0 current
	system (later or equal to September 25, 1999) with:

		cc test.c -lcurses

	and run each compilation result in a standard xterm (my termcap
	entry used was "xterms|vs100s" on 4.0 current) as described above
	in the Description section.

	The effect is also visible on the console using the pcvt
	driver in 3.2 and 4.0.


#include <curses.h>

#define MAXJ 10

main()
{
	WINDOW *windowp;
	int i, j;
	
	initscr();
	noecho();
	raw();

	if((windowp = newwin(10, COLS, 5, 0)) == NULL)
	{
		endwin();
		fprintf(stderr, "ERROR, curses init window\n");
		exit(1);
	}
	
	scrollok(windowp, 1);

	wmove(windowp, 0, 0);

	for(j=0; j < MAXJ; j++)
	{
		char buf[] = "BUFFER";
		char what[] = "WHAT";
		char msg[] = ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>";
		
                wprintw(windowp, "%d %s %s %-.*s\n", j, buf, what,
       	             COLS-((strlen(buf))+(strlen(what))+4), msg);
		wrefresh(windowp);
		sleep(1);
	}

	endwin();
}


>Fix:

	None.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->peter 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Mon Sep 27 00:30:12 PDT 1999 
Responsible-Changed-Why:  
The new ncurses is Peter's baby. 
State-Changed-From-To: open->closed 
State-Changed-By: rafan 
State-Changed-When: Sat Apr 28 15:08:09 UTC 2007 
State-Changed-Why:  
According to ncurses author, the extra line is expected 
behavior and Solaris/Tru64's curses lib does the same thing. 
Submitter agrees to close this PR since it's something 
related to ncurses itself and should be addressed there. 


Responsible-Changed-From-To: peter->rafan 
Responsible-Changed-By: rafan 
Responsible-Changed-When: Sat Apr 28 15:08:09 UTC 2007 
Responsible-Changed-Why:  
ncurses is now my baby. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=13978 
>Unformatted:
