From owner-svn-src-head@FreeBSD.ORG Fri Jul 12 15:29:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2CDAFD9A; Fri, 12 Jul 2013 15:29:42 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1DB441C15; Fri, 12 Jul 2013 15:29:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CFTfJN048985; Fri, 12 Jul 2013 15:29:41 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CFTftp048983; Fri, 12 Jul 2013 15:29:41 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307121529.r6CFTftp048983@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 12 Jul 2013 15:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253271 - in head: bin/sh tools/regression/bin/sh/execution X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 12 Jul 2013 15:29:42 -0000 Author: jilles Date: Fri Jul 12 15:29:41 2013 New Revision: 253271 URL: http://svnweb.freebsd.org/changeset/base/253271 Log: sh: Do not read from stdin if an error occurs during -i -c cmd. Although using -i with -c does not seem very useful, it seems inappropriate to read commands from the terminal in this case. Side effect: if the -s -c extension is used and the -s option is turned off using 'set +s' during the interactive part, the shell now exits after an error or interrupt. Note that POSIX only specifies -s as option to sh, not to set. See also Austin Group issue #718. Added: head/tools/regression/bin/sh/execution/int-cmd1.0 (contents, props changed) Modified: head/bin/sh/main.c Modified: head/bin/sh/main.c ============================================================================== --- head/bin/sh/main.c Fri Jul 12 15:08:37 2013 (r253270) +++ head/bin/sh/main.c Fri Jul 12 15:29:41 2013 (r253271) @@ -170,8 +170,8 @@ state3: if (minusc) { evalstring(minusc, sflag ? 0 : EV_EXIT); } +state4: if (sflag || minusc == NULL) { -state4: /* XXX ??? - why isn't this before the "if" statement */ cmdloop(1); } exitshell(exitstatus); Added: head/tools/regression/bin/sh/execution/int-cmd1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/execution/int-cmd1.0 Fri Jul 12 15:29:41 2013 (r253271) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +! echo echo bad | $SH -ic 'fi' 2>/dev/null