[net.bugs.usg] Another bug in System 5.2 curses

laman@sdcsvax.UUCP (08/30/84)

There is a bug with the "sgr" parameter values as documented on page 10
(fourth paragraph in the "Highlighting, Underlining and Visible Bells" section)
of the terminfo(4) document in the System V.2 Programmer Reference Manual.
The paragraph talks about the "sgr"'s nine parameters.  It states:

	"Each parameter is either 0 or 1, as the corresponding
	attribute is on or off."

Wrong!  It is 0 or NONZERO.  I wrote a string to describe the ability (of the
terminals which we use) to use this by multiplying the given attribute's
parameter value to shift the bit to the appropriate position and "or"ing each
value together as I processed each attribute that I could implement.
I ended up generating a character that was unchanged from my bias character
(with which I started "or"ing) since the values were not only not 1, but were
values that wouldn't even fit in a byte.  This is caused by the call to
"tparm()" in screen/vidputs.c in the function "vidputs()".  On approximately
line #23, you see lines like:

						:
						:
					newmode & A_STANDOUT,
						:
						:

These are the values that get passed as the "parameters" for the "sgr"
attribute processing.  A quick glance in curses.h will show that "A_STANDOUT"
is not 1 (nor are any of the other 8 attribute mode masks).

	The fix is simple.  Change each line to look like:

						:
						:
					(newmode & A_STANDOUT) != 0,
						:
						:

	Make sure you change all 9 attribute parameter arguments to boolean
comparisons!

Sorry, but I don't have any sources on this system so I don't have a nice
"diff" output.

		Mike Laman, NCR @ Torrey Pines
		UUCP: {ucbvax,philabs,sdcsla}!sdcsvax!laman