[7371] in Athena Bugs
bug in xterm
daemon@ATHENA.MIT.EDU (Pierre A. Humblet)
Fri Mar 29 20:30:30 1991
Date: Fri, 29 Mar 91 20:30:22 est
From: humblet@lids.mit.edu (Pierre A. Humblet)
To: bugs@ATHENA.MIT.EDU
A few days ago I asked olc a question about the Tektronix window in xterm.
They referred me to the sources in /source/third/common/X11R4/clients/xterm
I think I have found a bug in Tekproc.c; it only appears when trying to
get full resolution. See above the **************** below.
Pierre Humblet
getpoint()
{
register int c, x, y, e, lo_y = 0;
register TScreen *screen = &term->screen;
x = screen->cur.x;
y = screen->cur.y;
for( ; ; ) {
if((c = input()) < ' ') { /* control character */
unput(c);
return(0);
}
if(c < '@') { /* Hi X or Hi Y */
if(lo_y) { /* seen a Lo Y, so this must be Hi X */ x &= ~HIBITS;
x |= (c & FIVEBITS) << SHIFTHI;
continue;
}
/* else Hi Y */
y &= ~HIBITS;
y |= (c & FIVEBITS) << SHIFTHI;
continue;
}
if(c < '`') { /* Lo X */
x &= ~LOBITS;
x |= (c & FIVEBITS) << SHIFTLO;
screen->cur.x = x;
screen->cur.y = y;
return(1); /* OK */
}
/* else Lo Y */
if(lo_y) { /* seen a Lo Y, so other must be extra bits */
e = (y >> SHIFTLO) & EXTRABITS;
**************************************************************************
in the previous line (y >> SHIFTLO) should be (c >> SHIFTLO)
*************************************************************************
x &= ~TWOBITS;
x |= e & TWOBITS;
y &= ~TWOBITS;
y |= (e >> SHIFTLO) & TWOBITS;
}
y |= (c & FIVEBITS) << SHIFTLO;
lo_y++;
}
}