Fix some other problems created during the termios switch.

This commit is contained in:
mycroft 1995-10-05 00:54:45 +00:00
parent 2da76ff341
commit a38b5c448f

View File

@ -33,7 +33,7 @@
#ifndef lint #ifndef lint
/*static char sccsid[] = "from: @(#)subr.c 8.1 (Berkeley) 6/4/93";*/ /*static char sccsid[] = "from: @(#)subr.c 8.1 (Berkeley) 6/4/93";*/
static char rcsid[] = "$Id: subr.c,v 1.15 1995/10/05 00:40:33 mycroft Exp $"; static char rcsid[] = "$Id: subr.c,v 1.16 1995/10/05 00:54:45 mycroft Exp $";
#endif /* not lint */ #endif /* not lint */
/* /*
@ -235,7 +235,7 @@ setflags(n)
#define BICS(v,c,s) BIC(v,c),BIS(v,s) #define BICS(v,c,s) BIC(v,c),BIS(v,s)
iflag = omode.c_iflag; iflag = omode.c_iflag;
oflag = 0; oflag = omode.c_oflag;
cflag = omode.c_cflag; cflag = omode.c_cflag;
lflag = omode.c_lflag; lflag = omode.c_lflag;
@ -280,6 +280,11 @@ setflags(n)
oflag &= ~ONLCR; oflag &= ~ONLCR;
} }
if (!HT)
oflag |= OXTABS|OPOST;
else
oflag &= ~OXTABS;
#ifdef XXX_DELAY #ifdef XXX_DELAY
f |= delaybits(); f |= delaybits();
#endif #endif
@ -287,7 +292,7 @@ setflags(n)
if (n == 1) { /* read mode flags */ if (n == 1) { /* read mode flags */
if (RW) { if (RW) {
iflag = 0; iflag = 0;
oflag = 0; oflag &= ~OPOST;
BICS(cflag, CSIZE|PARENB|PARODD, CS8); BICS(cflag, CSIZE|PARENB|PARODD, CS8);
lflag = 0; lflag = 0;
} else { } else {
@ -296,11 +301,6 @@ setflags(n)
goto out; goto out;
} }
if (HT)
oflag &= ~OXTABS;
else
oflag |= OXTABS|OPOST;
if (n == 0) if (n == 0)
goto out; goto out;
@ -311,21 +311,33 @@ setflags(n)
if (CE) if (CE)
lflag |= ECHOE; lflag |= ECHOE;
else
lflag &= ~ECHOE;
if (CK) if (CK)
lflag |= ECHOKE; lflag |= ECHOKE;
else
lflag &= ~ECHOKE;
if (PE) if (PE)
lflag |= ECHOPRT; lflag |= ECHOPRT;
else
lflag &= ~ECHOPRT;
if (EC) if (EC)
lflag |= ECHO; lflag |= ECHO;
else
lflag &= ~ECHO;
if (XC) if (XC)
lflag |= ECHOCTL; lflag |= ECHOCTL;
else
lflag &= ~ECHOCTL;
if (DX) if (DX)
lflag |= IXANY; lflag |= IXANY;
else
lflag &= ~IXANY;
out: out:
tmode.c_iflag = iflag; tmode.c_iflag = iflag;