Article View: net.bugs
Article #45curses bug
From: utzoodecvaxittvaxtpdcvaxbobvan
Date: Mon, 27 Sep 1982 12:33
Date: Mon, 27 Sep 1982 12:33
50 lines
1967 bytes
1967 bytes
I've tracked down a bug in curses on our 4.1BSD system, but I suspect
that it is present in all curseses. It manifests itself as garbage
characters on your screen and is agrivated when using windows with
the left edge between column 0 and 7. Here is a short C program that
shows the problem. Note that if your terminal can't do CR without LF,
curses won't go for (and botch) the optimization. It is known to fail
on VT-100's (sounds like a cigarette).
#include <curses.h>
main()
{
WINDOW *w;
initscr();
w = newwin(3, 4, 4, 3);
box(w, ':', '.');
wrefresh();
endwin();
}
I have a fix, but make no claims about the quality. With the fix
installed, the bug goes away. However, it contains a goto and the code
around there is fairly crufty, so I don't want to make any guarantees.
Perhaps a Berkeley guru would like to suggest something cleaner?
A diff -c of the fix follows:
*** /usr/src/lib/libcurses/cr_put.c Thu Mar 5 22:56:56 1981
--- cr_put.c Thu Sep 23 13:47:52 1982
***************
*** 255,260
if (plodflg) /* avoid a complex calculation */
plodcnt--;
else {
c = _win->_y[outline-_win->_begy][outcol-_win->_begx];
if ((c&_STANDOUT) == (curscr->_flags&_STANDOUT))
putchar(c);
--- 255,262 -----
if (plodflg) /* avoid a complex calculation */
plodcnt--;
else {
+ if (outcol < _win->_begx) /* RAV hack fix */
+ goto nondes;
c = _win->_y[outline-_win->_begy][outcol-_win->_begx];
if ((c&_STANDOUT) == (curscr->_flags&_STANDOUT))
putchar(c);
------------------------------------
Bob Van Valzah
(...!decvax!ittvax!tpdcvax!bobvan)
Technical Details
Message-ID:
<bnews.tpdcvax.169>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
From: utzoo!decvax!ittvax!tpdcvax!bobvan Newsgroups: net.bugs Title: curses bug Article-I.D.: tpdcvax.169 Posted: Mon Sep 27 12:33:18 1982 Received: Thu Sep 30 10:15:21 1982 Subject: curses bug Date: Mon, 27 Sep 1982 12:33:18 +0000 Message-ID: <bnews.tpdcvax.169>