Xref: utzoo comp.lang.c:12859 comp.unix.questions:9365
Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ukma!husc6!panda!teddy!jpn
From: jpn@teddy.UUCP (John P. Nelson)
Newsgroups: comp.lang.c,comp.unix.questions
Subject: Re: Curses differences on 4.3 and Ultrix V2.2
Message-ID: <5008@teddy.UUCP>
Date: 22 Sep 88 20:42:15 GMT
References: <3711@cheviot.newcastle.ac.uk> <38132@yale-celray.yale.UUCP>
Reply-To: jpn@teddy.UUCP (John P. Nelson)
Organization: GenRad, Inc., Concord, Mass.
Lines: 26

| 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@teddy.genrad.com