summaryrefslogtreecommitdiffstats
path: root/bin/stty
diff options
context:
space:
mode:
Diffstat (limited to 'bin/stty')
-rw-r--r--bin/stty/key.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/bin/stty/key.c b/bin/stty/key.c
index 413f4d5..1241301 100644
--- a/bin/stty/key.c
+++ b/bin/stty/key.c
@@ -257,14 +257,15 @@ f_rows(struct info *ip)
void
f_sane(struct info *ip)
{
+ struct termios def;
- ip->t.c_cflag = TTYDEF_CFLAG | (ip->t.c_cflag & CLOCAL);
- ip->t.c_iflag = TTYDEF_IFLAG;
- ip->t.c_iflag |= ICRNL;
+ cfmakesane(&def);
+ ip->t.c_cflag = def.c_cflag | (ip->t.c_cflag & CLOCAL);
+ ip->t.c_iflag = def.c_iflag;
/* preserve user-preference flags in lflag */
#define LKEEP (ECHOKE|ECHOE|ECHOK|ECHOPRT|ECHOCTL|ALTWERASE|TOSTOP|NOFLSH)
- ip->t.c_lflag = TTYDEF_LFLAG | (ip->t.c_lflag & LKEEP);
- ip->t.c_oflag = TTYDEF_OFLAG;
+ ip->t.c_lflag = def.c_lflag | (ip->t.c_lflag & LKEEP);
+ ip->t.c_oflag = def.c_oflag;
ip->set = 1;
}
OpenPOWER on IntegriCloud