From owner-svn-src-head@FreeBSD.ORG Sun May 30 14:11:27 2010 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 9FE7A1065670; Sun, 30 May 2010 14:11:27 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E7828FC0C; Sun, 30 May 2010 14:11:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4UEBRiw065264; Sun, 30 May 2010 14:11:27 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4UEBRYc065260; Sun, 30 May 2010 14:11:27 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005301411.o4UEBRYc065260@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 30 May 2010 14:11:27 +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: r208655 - in head: bin/sh tools/regression/bin/sh/parser 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, 30 May 2010 14:11:27 -0000 Author: jilles Date: Sun May 30 14:11:27 2010 New Revision: 208655 URL: http://svn.freebsd.org/changeset/base/208655 Log: sh: Change interaction of command substitution and here documents. If a command substitution contains a newline token, this no longer starts here documents of outer commands. This way, we follow POSIX's idea of the command substitution being a separate script more closely. It also matches other shells better and is consistent with newline characters in quotes not starting here documents. The extension tested in parser/heredoc3.0 ($(cat <next != NULL) + here = here->next; + here->next = heredoclist; + heredoclist = saveheredoclist; } handler = savehandler; + INTON; if (quoted) USTPUTC(CTLBACKQ | CTLQUOTE, out); else Added: head/tools/regression/bin/sh/parser/heredoc4.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/heredoc4.0 Sun May 30 14:11:27 2010 (r208655) @@ -0,0 +1,44 @@ +# $FreeBSD$ + +failures=0 + +check() { + if ! eval "[ $* ]"; then + echo "Failed: $*" + : $((failures += 1)) + fi +} + +f() { + cat <