From owner-svn-src-all@FreeBSD.ORG Thu Sep 23 20:37:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A0C51065675; Thu, 23 Sep 2010 20:37:30 +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 087738FC08; Thu, 23 Sep 2010 20:37:30 +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 o8NKbT7o079886; Thu, 23 Sep 2010 20:37:29 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8NKbTkv079885; Thu, 23 Sep 2010 20:37:29 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201009232037.o8NKbTkv079885@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 23 Sep 2010 20:37:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213085 - stable/8/tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 20:37:30 -0000 Author: jilles Date: Thu Sep 23 20:37:29 2010 New Revision: 213085 URL: http://svn.freebsd.org/changeset/base/213085 Log: MFC r212187: sh: Add a test that 'read' leaves the file pointer at the correct place. Naive buffering would break the common while read x... construct, which did not appear to be tested yet. Added: stable/8/tools/regression/bin/sh/builtins/read2.0 - copied unchanged from r212187, head/tools/regression/bin/sh/builtins/read2.0 Modified: Directory Properties: stable/8/tools/regression/bin/sh/ (props changed) Copied: stable/8/tools/regression/bin/sh/builtins/read2.0 (from r212187, head/tools/regression/bin/sh/builtins/read2.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/builtins/read2.0 Thu Sep 23 20:37:29 2010 (r213085, copy of r212187, head/tools/regression/bin/sh/builtins/read2.0) @@ -0,0 +1,31 @@ +# $FreeBSD$ + +set -e +{ + echo 1 + echo two + echo three +} | { + read x + [ "$x" = 1 ] + (read x + [ "$x" = two ]) + read x + [ "$x" = three ] +} + +T=`mktemp sh-test.XXXXXX` +trap 'rm -f "$T"' 0 +{ + echo 1 + echo two + echo three +} >$T +{ + read x + [ "$x" = 1 ] + (read x + [ "$x" = two ]) + read x + [ "$x" = three ] +} <$T