Curses bug (Both net.sources dist. and 4.2 BSD)

Mike Laman laman at sdcsvax.UUCP
Sat Nov 12 09:08:04 AEST 1983


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



More information about the Comp.bugs.4bsd.ucb-fixes mailing list