[net.bugs] sort of big inews bug

smk (11/29/82)

In our version of inews, there is a bug in that the tty variable is tested
all over the place before it is properly defined (via the isatty() function).
As a result, inews never thinks input comes from the terminal and we can't
use inews directly.  The following diff will fix this up.

	--steve


*** inews.c.orig	Sun Nov  7 11:01:51 1982
--- inews.c	Sun Nov 28 21:05:28 1982
***************
*** 91,96
  /*
  	signal(SIGQUIT, SIG_IGN);
  */
  	signal(SIGHUP, onsig);
  	signal(SIGINT, onsig);
  	savmask = umask(N_UMASK);	/* set up mask */

--- 91,104 -----
  /*
  	signal(SIGQUIT, SIG_IGN);
  */
+ #ifdef MITRE
+ 	/*	This is needed because if the connection to the remote
+ 		machine is dropped after an rnews is started, a SIGHUP
+ 		is sent to rnews and a message is passed back.  This
+ 		will stop that.	*/
+ 	if(mode != PROC)
+ 		signal(SIGHUP, onsig);
+ #else
  	signal(SIGHUP, onsig);
  #endif
  	signal(SIGINT, onsig);
***************
*** 92,97
  	signal(SIGQUIT, SIG_IGN);
  */
  	signal(SIGHUP, onsig);
  	signal(SIGINT, onsig);
  	savmask = umask(N_UMASK);	/* set up mask */
  	uid = (unsigned) getuid();

--- 100,106 -----
  		signal(SIGHUP, onsig);
  #else
  	signal(SIGHUP, onsig);
+ #endif
  	signal(SIGINT, onsig);
  	savmask = umask(N_UMASK);	/* set up mask */
  	uid = (unsigned) getuid();
***************
*** 198,203
  	 * ALL of the command line has now been processed. (!)
  	 */
  
  	if (!Dflag && mode != PROC) {
  		if (recording(header.nbuf)) {
  			if (!tty)

--- 207,218 -----
  	 * ALL of the command line has now been processed. (!)
  	 */
  
+ #ifdef MITRE
+ 	/*	This was moved from below since references to tty
+ 		are made before it is set.	*/
+ 	tty = isatty(fileno(stdin));
+ 
+ #endif
  	if (!Dflag && mode != PROC) {
  		if (recording(header.nbuf)) {
  			if (!tty)