[comp.sources.d] Sc 4.1, BSD4.2 and Ultrix

rgb@nscpdc.NSC.COM (Robert Bond) (08/21/87)

I thought I would get the jump on all of you, now that sc 4.1 has made it
through the comp.sources.unix queue.  Here is the reason, as related
last time by Eric, why Sc makes hash out of the screen on a stock
4.2 BSD or Ultrix 1.x system:


Bob--

     sc/vc compiled and ran fine on a VAX running 4.3 BSD at my site.  However,
it compiled, but screwed up the nl()/nonl() stuff, when run on my MicroVAX II
running Ultrix 1.2; the same problem occurred on a VAX running vanilla 4.2 BSD.
I traced it to a bug in the nl()/nonl() definitions in /usr/include/curses.h
that appears to exist only in the 4.2 BSD and Ultrix 1.X versions of that file.
I suspect that someone had fixed those definitions on the 4.2 BSD system you
tested it on.  (In fact, on a Sun 2 at my site running Sun UNIX 3.0 [basically
4.2 BSD with Sun enhancements], the nl()/nonl() stuff in /usr/include/curses.h
has been fixed [by Sun].  I haven't tried compiling sc/vc on it yet, however.) 

     The following patch to sc.c is necessary for vanilla 4.2 BSD machines and
Ultrix 1.2 (and presumably Ultrix 1.0 and 1.1) machines: 

*** sc.c	Tue Jan 27 15:54:31 1987
--- sc.c.new	Tue Jan 27 15:55:06 1987
***************
*** 14,19 ****
--- 14,26 ----
  #include <curses.h>
  
+ #ifdef BSD42
+ #undef nl
+ #undef nonl
+ #define nl()	 (_tty.sg_flags |= CRMOD,_pfast = _rawmode,stty(_tty_ch, &_tty))
+ #define nonl()	 (_tty.sg_flags &= ~CRMOD, _pfast = TRUE, stty(_tty_ch, &_tty))
+ #endif
+ 
  #ifdef BSD42
  #include <strings.h>
  #else
  #ifndef SYSIII

Perhaps you should post it to comp.sources.d.  Thanks.

--Eric
-------------------------------------------
  Eric S. Goldman, M.D.
  UCSF School of Medicine
  INET: goldman@cope.ucsf.edu
  UUCP: ...ucbvax!ucsfcgl!cope.ucsf!goldman
  BITNET: GOLDMAN@UCSFCOPE.BITNET

-- 
    Robert Bond 			ihnp4!nsc!nscpdc!rgb
    National Semiconductor		tektronix!nscpdc!rgb