[net.unix-wizards] bug in csh

eric%cit-vax@sri-unix.UUCP (02/02/84)

From:  Eric Holstege <eric@cit-vax>

Under 4.2, if the terminal is in raw mode (for example, an editor just bombed)
the first character with the high (parity) bit set will log out the csh.
This is because, in the routine bgetc in sh.lex.c, a character is read
from the terminal and returned as an integer. This causes sign extension
of the parity bit, resulting in a negative integer. Routines calling
bgetc test for < 0 to detect EOF. The fix is to chaange the two occurrences
of "return(c)" in bgetc to "return(c&0177)".