From owner-svn-src-head@FreeBSD.ORG Sun Feb 20 14:18:59 2011 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 4A57C1065673; Sun, 20 Feb 2011 14:18:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCC468FC18; Sun, 20 Feb 2011 14:18:58 +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 p1KEIw0x034895; Sun, 20 Feb 2011 14:18:58 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1KEIwPe034890; Sun, 20 Feb 2011 14:18:58 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201102201418.p1KEIwPe034890@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 20 Feb 2011 14:18:58 +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: r218889 - in head/tools/regression/bin/sh: builtins 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, 20 Feb 2011 14:18:59 -0000 Author: jilles Date: Sun Feb 20 14:18:58 2011 New Revision: 218889 URL: http://svn.freebsd.org/changeset/base/218889 Log: sh: Split off some special behaviour into separate tests. This allows some other shells to pass the tests for basic behaviour. Added: head/tools/regression/bin/sh/builtins/trap8.0 (contents, props changed) head/tools/regression/bin/sh/parser/for2.0 (contents, props changed) Modified: head/tools/regression/bin/sh/builtins/trap3.0 head/tools/regression/bin/sh/parser/for1.0 Modified: head/tools/regression/bin/sh/builtins/trap3.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/trap3.0 Sun Feb 20 13:07:10 2011 (r218888) +++ head/tools/regression/bin/sh/builtins/trap3.0 Sun Feb 20 14:18:58 2011 (r218889) @@ -8,5 +8,4 @@ trap - 99999 && exit 3 trap true 99999 && exit 3 } 2>/dev/null -test -n "$(trap true garbage TERM 2>/dev/null || trap)" || exit 3 exit 0 Added: head/tools/regression/bin/sh/builtins/trap8.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/trap8.0 Sun Feb 20 14:18:58 2011 (r218889) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +# I am not sure if POSIX requires the shell to continue processing +# further trap names in the same trap command after an invalid one. + +test -n "$(trap true garbage TERM 2>/dev/null || trap)" || exit 3 +exit 0 Modified: head/tools/regression/bin/sh/parser/for1.0 ============================================================================== --- head/tools/regression/bin/sh/parser/for1.0 Sun Feb 20 13:07:10 2011 (r218888) +++ head/tools/regression/bin/sh/parser/for1.0 Sun Feb 20 14:18:58 2011 (r218889) @@ -13,7 +13,7 @@ for s1 in "$nl" " "; do done done set -- $list -for s2 in "$nl" " " ";" ";$nl"; do # s2=";" and ";$nl" are extensions to POSIX +for s2 in "$nl" " "; do for s3 in "$nl" " "; do r='' eval "for i${s2}do${s3}r=\"\$r \$i\"; done" Added: head/tools/regression/bin/sh/parser/for2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/for2.0 Sun Feb 20 14:18:58 2011 (r218889) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +# Common extensions to the 'for' syntax. + +nl=' +' +list=' a b c' +set -- $list +for s2 in ";" ";$nl"; do + for s3 in "$nl" " "; do + r='' + eval "for i${s2}do${s3}r=\"\$r \$i\"; done" + [ "$r" = "$list" ] || exit 1 + done +done