From owner-svn-src-head@freebsd.org Sun Aug 16 12:57:18 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB0FB9B99B8; Sun, 16 Aug 2015 12:57:18 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBACD1355; Sun, 16 Aug 2015 12:57:18 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7GCvI1A062539; Sun, 16 Aug 2015 12:57:18 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7GCvI7c062536; Sun, 16 Aug 2015 12:57:18 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201508161257.t7GCvI7c062536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 16 Aug 2015 12:57:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286826 - in head/bin/sh: . tests/builtins 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.20 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, 16 Aug 2015 12:57:19 -0000 Author: jilles Date: Sun Aug 16 12:57:17 2015 New Revision: 286826 URL: https://svnweb.freebsd.org/changeset/base/286826 Log: sh: Backslash-newline should not affect field splitting in read builtin. This was originally broken in r212339 in 2010. Added: head/bin/sh/tests/builtins/read8.0 (contents, props changed) Modified: head/bin/sh/miscbltin.c head/bin/sh/tests/builtins/Makefile Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Sun Aug 16 12:23:58 2015 (r286825) +++ head/bin/sh/miscbltin.c Sun Aug 16 12:57:17 2015 (r286826) @@ -191,9 +191,10 @@ readcmd(int argc __unused, char **argv _ CHECKSTRSPACE(1, p); if (backslash) { backslash = 0; - startword = 0; - if (c != '\n') + if (c != '\n') { + startword = 0; USTPUTC(c, p); + } continue; } if (!rflag && c == '\\') { Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Sun Aug 16 12:23:58 2015 (r286825) +++ head/bin/sh/tests/builtins/Makefile Sun Aug 16 12:57:17 2015 (r286826) @@ -121,6 +121,7 @@ FILES+= read4.0 read4.0.stdout FILES+= read5.0 FILES+= read6.0 FILES+= read7.0 +FILES+= read8.0 FILES+= return1.0 FILES+= return2.1 FILES+= return3.1 Added: head/bin/sh/tests/builtins/read8.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/read8.0 Sun Aug 16 12:57:17 2015 (r286826) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +read a b c <<\EOF +\ +A\ + \ + \ + \ +B\ + \ + \ +C\ + \ + \ + \ +EOF +[ "$a.$b.$c" = "A.B.C" ]