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

laman@sdcsvax.UUCP (Mike Laman) (08/15/84)

After posting my ~6 bugs for 5.2 curses, I received the following bug
notification.  I thought I would share it with the net.  The wording
is mine, but FULL credit for the fix goes to "akgua!whuxle!mp (Mark Plotnick)".
Thanks Mark!

On approximately line #310 in "tparm()" (screen/tparm.c) is the following line
of code that handles the "%=" stack manipulation as documented at the top of
page 8 in the 5.2 Programmer Reference Manual concerning the parameterized
string manipulation ( inhale ).  It is supposed to COMPARE, but it ASSIGNS
instead.  ("%=" means to COMPARE for equality the top two stack elements (which
are poped) and push the result.)

	case '=': c=pop(); op=pop(); push(op = c); break;
					     ^
					     |

					This is effectively putting the
					top element back on top of the stack.
					=> This operation only removes the
					   second element.
This line should be:

	case '=': c=pop(); op=pop(); push(op == c); break;

		Mike Laman
		UUCP: {ucbvax,philabs,sdcsla}!sdcsvax!laman