🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #13534

Bug in SunOs -lcurses

#13534
From: Gregory N. Bond
Date: Thu, 01 Feb 1990 21:16
44 lines
2039 bytes
This bug has been in SunOs -lcurses since (at least) 3.5, but it is only a
problem since SunOs 4.0 became 8-bit transparent.  In certain situations,
termcap emits space characters with the high order bit set.  This causes
"interesting" problems with SunOs 4.0 version of shelltool.  (The bug was
noticed when the sc spreadsheet (see comp.sources.unix) was mangling the
row/column labels.)

/*
 *	Show a bug in SunOs 4.0.3 curses.
 *
 *	This program should generate a line of highlighted letters spaced
 *	every 4 characters.  Instead, it produces a highlighted line like 
 *	"ABCDEFGHIJKLMNO"  (when run under the SunOs 4.0 shelltool or cmdtool).
 *
 *	The reason?  The second refresh() is redrawing the line with Meta-space 
 *	characters (0xA0 or 0240), which are ignored by the 4.0.3 shelltool.  
 *	Running the output through an 8th-bit stripping program makes it work.
 *
 *	This worked under SunOs 3.5, as the shelltool ignored the 8th bit.
 *
 *	Compile by: Save in a file "cbug.c" and click and stuff this line:
cc -o cbug cbug.c -lcurses -ltermcap
 */
#include <curses.h>

main()
{
	initscr();
	standout();

	move (1,0);
	printw("       A       B       C       D       E       F       G       ");
	refresh();

	move (1,0);
	printw("   A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   ");
	refresh();

	endwin();
}

Gregory Bond, Burdett Buckeridge & Young Ltd, Melbourne, Australia
Internet: gnb@melba.bby.oz.au    non-MX: gnb%melba.bby.oz@uunet.uu.net
Uucp: {uunet,pyramid,ubc-cs,ukc,mcvax,prlb2,nttlab...}!munnari!melba.bby.oz!gnb
Technical Details
Message-ID: <4649@brazos.Rice.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!rutgers!mit-eddie!uw-beaver!rice!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!rutgers!mit-eddie!uw-beaver!rice!sun-spots-request
From: gnb@melba.oz.au (Gregory N. Bond)
Newsgroups: comp.sys.sun
Subject: Bug in SunOs -lcurses
Keywords: SunOS
Message-ID: <4649@brazos.Rice.edu>
Date: 1 Feb 90 21:16:06 GMT
Sender: root@rice.edu
Organization: Sun-Spots
Lines: 44
Approved: Sun-Spots@rice.edu
X-Sun-Spots-Digest: Volume 9, Issue 22, message 7 of 16