From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 19:09:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 002F7106566C; Sun, 8 Mar 2009 19:09:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E14FD8FC16; Sun, 8 Mar 2009 19:09:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n28J9tV9092710; Sun, 8 Mar 2009 19:09:55 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n28J9tVg092709; Sun, 8 Mar 2009 19:09:55 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200903081909.n28J9tVg092709@svn.freebsd.org> From: Ed Schouten Date: Sun, 8 Mar 2009 19:09:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189542 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2009 19:09:56 -0000 Author: ed Date: Sun Mar 8 19:09:55 2009 New Revision: 189542 URL: http://svn.freebsd.org/changeset/base/189542 Log: 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 Modified: head/bin/sh/miscbltin.c Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Sun Mar 8 19:07:44 2009 (r189541) +++ head/bin/sh/miscbltin.c Sun Mar 8 19:09:55 2009 (r189542) @@ -147,6 +147,7 @@ readcmd(int argc __unused, char **argv _ 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; }