Curses differences on 4.3 and Ultrix V2.2
John P. Nelson
jpn at teddy.UUCP
Fri Sep 23 06:42:15 AEST 1988
| I wrote a simple windowing system using Curses on a 4.3 machine. Eventually
| it worked but now when I recompile it and run it on an Ultrix machine the
| windows get messed up. I have checked Termcap entries and STTY entries which
| seem OK, and so I conclude that there are differences between Curses on the
| two machines. Can any one back up this conclusion and maybe suggest where the
| problem might be.
The Ultrix "curses.h" has a bug in the definition of the nl() and nonl()
functions. In fact, the header has comments showing how some dec programmer
"fixed" it (it's quite clear he didn't understand it). I have reported this
bug to DEC for every release since 1.1. It's STILL broken in 3.0!
Dec defines the macros this way:
#define nl() (_tty.sg_flags |= CRMOD,_pfast = _rawmode,NONL = 0,stty(_tty_ch, &_tty))
#define nonl() (_tty.sg_flags &= ~CRMOD, _pfast = TRUE, NONL = 1,stty(_tty_ch, &_tty))
However, they SHOULD be defined as:
#define nl() (_tty.sg_flags |= CRMOD,_pfast = _rawmode,stty(_tty_ch, &_tty))
#define nonl() (_tty.sg_flags &= ~CRMOD, _pfast = TRUE, stty(_tty_ch, &_tty))
--
john nelson
UUCP: {decvax,mit-eddie}!genrad!teddy!jpn
smail: jpn at teddy.genrad.com
More information about the Comp.unix.questions
mailing list