Date: Sun, 8 Mar 2009 19:10:03 GMT From: Ed Schouten <ed@80386.nl> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/129566: behavioral change of "read" builtin for sh(1) on 8-CURRENT [regression] Message-ID: <200903081910.n28JA31G077723@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/129566; it has been noted by GNATS. From: Ed Schouten <ed@80386.nl> To: bug-followup@FreeBSD.org, mike@jellydonunt.org Cc: jilles@stack.nl Subject: Re: bin/129566: behavioral change of "read" builtin for sh(1) on 8-CURRENT [regression] Date: Sun, 8 Mar 2009 20:03:37 +0100 --8Ioc0IVuiHZoupes Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, As Jilles pointed out, the new TTY layer does not perform any post-processing before returning data to userspace. This makes the design of the TTY layer a lot more simple, while still complying to the standards. This means sh(1)'s behaviour it not correct, because it calls select() with ICRNL disabled. The following patch should fix this: Index: miscbltin.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- miscbltin.c (revision 189489) +++ miscbltin.c (working copy) @@ -147,6 +147,7 @@ if (tcgetattr(0, &told) =3D=3D 0) { memcpy(&tnew, &told, sizeof(told)); cfmakeraw(&tnew); + tnew.c_iflag |=3D ICRNL; tcsetattr(0, TCSANOW, &tnew); tsaved =3D 1; } Please let me know if it fixes your issue. If it does, I'll commit it to SVN and MFC it as well. --=20 Ed Schouten <ed@80386.nl> WWW: http://80386.nl/ --8Ioc0IVuiHZoupes Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkm0FokACgkQ52SDGA2eCwVVYwCcDDwXL2gw3GDE4Ak1iw9Jdabr ptoAnjIpxhLsoU4egBZvcVF2e8YB/TRa =xY6E -----END PGP SIGNATURE----- --8Ioc0IVuiHZoupes--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903081910.n28JA31G077723>