🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.4bsd
Article #114

BSD curses sometimes outputs 8-bit chars

#114
From: Karl Heuer
Date: Mon, 02 Oct 1989 23:34
31 lines
1504 bytes
The obvious optimization of rightward cursor-motion is to emit the character
that's already under the cursor.  This includes the case where the character
in question has the standout bit set, and the physical terminal is already in
standout mode.

Unfortunately, the code as written emits the whole char, without masking off
the standout bit.  If your system and terminal don't ignore the high-order bit
on output, the wrong data will get written to the screen.  This has been
observed by running a curses program in a sunview window.

The problem can be fixed with the enclosed patch.

*** cr_put.c~	Fri Jun  7 23:59:37 1985
--- cr_put.c	Thu Sep 28 23:08:12 1989
***************
*** 348,354 ****
  			else {
  				i = curscr->_y[outline][outcol];
  				if ((i&_STANDOUT) == (curscr->_flags&_STANDOUT))
! 					_putchar(i);
  				else
  					goto nondes;
  			}
--- 348,354 ----
  			else {
  				i = curscr->_y[outline][outcol];
  				if ((i&_STANDOUT) == (curscr->_flags&_STANDOUT))
! 					_putchar(i & 0x7F);
  				else
  					goto nondes;
  			}
Technical Details
Message-ID: <14799@haddock.ima.isc.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!bloom-beacon!spdcc!ima!haddock!karl

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!bloom-beacon!spdcc!ima!haddock!karl
From: karl@haddock.ima.isc.com (Karl Heuer)
Newsgroups: comp.bugs.4bsd
Subject: BSD curses sometimes outputs 8-bit chars
Message-ID: <14799@haddock.ima.isc.com>
Date: 2 Oct 89 23:34:55 GMT
Reply-To: karl@haddock.ima.isc.com (Karl Heuer)
Organization: Interactive Systems, Cambridge, MA 02138-5302
Lines: 31