summaryrefslogtreecommitdiffstats
path: root/bin/sh/miscbltin.c
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-03-08 19:09:55 +0000
committered <ed@FreeBSD.org>2009-03-08 19:09:55 +0000
commit0f248d82f6b3c86ed627009577cd722491679796 (patch)
treeaa71cb0a282efba6eebb83d2d5c4c3e257e5751a /bin/sh/miscbltin.c
parent92da1fbd23d9243e2b4acb8589d3bcc85036b853 (diff)
downloadFreeBSD-src-0f248d82f6b3c86ed627009577cd722491679796.zip
FreeBSD-src-0f248d82f6b3c86ed627009577cd722491679796.tar.gz
Don't disable CR-to-NL translation when waiting for data to arrive.
A difference between the old and the new TTY layer is that the new implementation does not perform any post-processing before returning data back to userspace when calling read(). sh(1)'s read turns the TTY into a raw mode before calling select(). This means that the first character will not receive any ICRNL processing. Inherit this flag from the original terminal attributes. Even though this issue is not present on RELENG_*, I'm MFCing it to make sh(1) in jails behave better. PR: bin/129566 MFC after: 2 weeks
Diffstat (limited to 'bin/sh/miscbltin.c')
-rw-r--r--bin/sh/miscbltin.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bin/sh/miscbltin.c b/bin/sh/miscbltin.c
index 6496f4a..88b7515 100644
--- a/bin/sh/miscbltin.c
+++ b/bin/sh/miscbltin.c
@@ -147,6 +147,7 @@ readcmd(int argc __unused, char **argv __unused)
if (tcgetattr(0, &told) == 0) {
memcpy(&tnew, &told, sizeof(told));
cfmakeraw(&tnew);
+ tnew.c_iflag |= told.c_iflag & ICRNL;
tcsetattr(0, TCSANOW, &tnew);
tsaved = 1;
}
OpenPOWER on IntegriCloud