Subject: Re: TTYs and 7E1
To: None <current-users@NetBSD.ORG>
From: Charles Hannum <mycroft@deshaw.com>
List: current-users
Date: 10/05/1995 02:43:52
In article <199509281543.LAA28943@mcci.com> tmm@mcci.com (Terry Moore)
writes:

   @@ -260,7 +266,8 @@
	   } else {
		   if ((tp->t_flags & LITOUT) && !(oflag & OPOST))
			   flags |= LITOUT;
   -		if (tp->t_flags & PASS8)
   +		if (tp->t_flags & PASS8 ||
   +		    (cflag & CSIZE) == CS8)
			   flags |= PASS8;
	   }

This isn't a bad idea, but it shouldn't be done if ISTRIP is set (in
which case we really ought to be at CS7 anyway).

I think that, with your input, I finally figured out the last pieces
of this puzzle.  The following should correct the handling of PASS8
and LITOUT modes.  Please let me know if you find any problems with
it.


Index: tty_compat.c
===================================================================
RCS file: /a/cvsroot/src/sys/kern/tty_compat.c,v
retrieving revision 1.22
diff -c -2 -r1.22 tty_compat.c
*** tty_compat.c	1995/10/05 01:42:22	1.22
--- tty_compat.c	1995/10/05 02:33:51
***************
*** 274,282 ****
  		} else
  			SET(flags, EVENP|ODDP);
! 	} else {
! 		if (ISSET(tp->t_flags, LITOUT) && !ISSET(oflag, OPOST))
! 			SET(flags, LITOUT);
! 		if (ISSET(tp->t_flags, PASS8))
  			SET(flags, PASS8);
  	}
  
--- 274,283 ----
  		} else
  			SET(flags, EVENP|ODDP);
! 	}
! 	if (ISSET(cflag, CSIZE) == CS8) {
! 		if (!ISSET(iflag, ISTRIP))
  			SET(flags, PASS8);
+ 		if (!ISSET(oflag, OPOST))
+ 			SET(flags, LITOUT);
  	}