summaryrefslogtreecommitdiff
path: root/bin/stty
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2010-11-02 17:00:56 +0000
committerEd Schouten <ed@FreeBSD.org>2010-11-02 17:00:56 +0000
commit736fc28680260f987a1a505d762cd3ba21310d3a (patch)
treef242e644964b102fa1b89235f6f64b8ce56638ed /bin/stty
parent204404e8902d9d3018c63723c30346a8d5f16afb (diff)
downloadsrc-test2-736fc28680260f987a1a505d762cd3ba21310d3a.tar.gz
src-test2-736fc28680260f987a1a505d762cd3ba21310d3a.zip
Notes
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 413f4d58dfa9..12413019f964 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;
}