🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.bugs
Article #147

Curses bug (net.sources and 4.2 distributions)

#147
From: Mike Laman
Date: Mon, 14 Nov 1983 01:17
40 lines
1830 bytes
I strongly suspect this fix didn't get out.  We got device full error messages
just when I posted this earlier this week.  Sorry, if you've saw the original.

There is a bug in wdeleteln().  This bug is in the curses library distributed
over net.sources, and in the 4.2 BSD distribution (that sdcsvax received
at least).

Even though the last line of the window gets cleared internally, its "refresh"
image may not.  The fix is simple.  Add the following two lines to the end
of the wdeleteln() routine.

	win->_firstch[win->_maxy-1] = 0;
	win->_lastch[win->_maxy-1] = win->_maxx - 1;

Now wrefresh() will look at the entire line.

I have enclosed a little program that will show you if you have the bug.  Just
compile it with you curses library (termlib too) and run it.

#include	<curses.h>

main() {
	register i;

	initscr();
	mvaddstr(0, 20, "This program will delete line #5 after");
	mvaddstr(1, 20, "writing the line number for each line.");
	for(i = 0; i < LINES; ++i)
		mvprintw(i, 0, "Line #%d", i);
	refresh();
	addstr("     You have the bug if the BOTTOM line is not COMPLETELY blank!");
	move(5, 0);
	deleteln();
	move(LINES - 3, 0);
	refresh();
	endwin();
}

			Mike Laman
			UUCP: {ucbvax,philabs,sdccsu3,sdcsla}!sdcsvax!laman
Technical Details
Message-ID: <2@sdcsvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!linus!security!genrad!decvax!sdchema!sdcsvax!laman

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site sdcsvax.UUCP
Path: arc1-ca.pugleaf.net!utzoo!linus!security!genrad!decvax!sdchema!sdcsvax!laman
From: laman@sdcsvax.UUCP (Mike Laman)
Newsgroups: net.bugs,net.bugs.4bsd
Subject: Curses bug (net.sources and 4.2 distributions)
Message-ID: <2@sdcsvax.UUCP>
Date: Sun, 13-Nov-83 20:17:52 EST
Article-I.D.: sdcsvax.2
Posted: Sun Nov 13 20:17:52 1983
Date-Received: Thu, 17-Nov-83 23:08:08 EST
Organization: U.C. San Diego, Computer Science Dept.
Lines: 40