From owner-freebsd-bugs@FreeBSD.ORG Sun Mar 8 19:10:03 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BC591065774 for ; Sun, 8 Mar 2009 19:10:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 7CCA38FC15 for ; Sun, 8 Mar 2009 19:10:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n28JA3Wl077724 for ; Sun, 8 Mar 2009 19:10:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n28JA31G077723; Sun, 8 Mar 2009 19:10:03 GMT (envelope-from gnats) Date: Sun, 8 Mar 2009 19:10:03 GMT Message-Id: <200903081910.n28JA31G077723@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Ed Schouten Cc: Subject: Re: bin/129566: behavioral change of "read" builtin for sh(1) on 8-CURRENT [regression] X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ed Schouten List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2009 19:10:04 -0000 The following reply was made to PR bin/129566; it has been noted by GNATS. From: Ed Schouten 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 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--