From owner-svn-src-head@FreeBSD.ORG Wed Sep 8 20:35:44 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 0ABD710656C5; Wed, 8 Sep 2010 20:35:44 +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 D38438FC1F; Wed, 8 Sep 2010 20:35:43 +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 o88KZhMT073740; Wed, 8 Sep 2010 20:35:43 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o88KZhIx073736; Wed, 8 Sep 2010 20:35:43 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201009082035.o88KZhIx073736@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 8 Sep 2010 20:35:43 +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: r212339 - in head: bin/sh tools/regression/bin/sh/builtins 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: Wed, 08 Sep 2010 20:35:44 -0000 Author: jilles Date: Wed Sep 8 20:35:43 2010 New Revision: 212339 URL: http://svn.freebsd.org/changeset/base/212339 Log: sh: Fix 'read' if all chars before the first IFS char are backslash-escaped. Backslash-escaped characters did not set the flag for a non-IFS character. MFC after: 2 weeks Added: head/tools/regression/bin/sh/builtins/read4.0 (contents, props changed) head/tools/regression/bin/sh/builtins/read4.0.stdout (contents, props changed) Modified: head/bin/sh/miscbltin.c Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Wed Sep 8 20:10:29 2010 (r212338) +++ head/bin/sh/miscbltin.c Wed Sep 8 20:35:43 2010 (r212339) @@ -174,6 +174,7 @@ readcmd(int argc __unused, char **argv _ continue; if (backslash) { backslash = 0; + startword = 0; if (c != '\n') STPUTC(c, p); continue; Added: head/tools/regression/bin/sh/builtins/read4.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/read4.0 Wed Sep 8 20:35:43 2010 (r212339) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +printf '%s\n' '\a\ b c' | { read a b; printf '%s\n' "x${a}x${b}x"; } +printf '%s\n' '\a b\ c' | { read a b; printf '%s\n' "x${a}x${b}x"; } +printf '%s\n' '\a\:b:c' | { IFS=: read a b; printf '%s\n' "x${a}x${b}x"; } +printf '%s\n' '\a:b\:c' | { IFS=: read a b; printf '%s\n' "x${a}x${b}x"; } +printf '%s\n' '\\ a' | { read a b; printf '%s\n' "x${a}x${b}x"; } +printf '%s\n' '\\:a' | { IFS=: read a b; printf '%s\n' "x${a}x${b}x"; } +printf '%s\n' '\\\ a' | { read a b; printf '%s\n' "x${a}x${b}x"; } +printf '%s\n' '\\\:a' | { IFS=: read a b; printf '%s\n' "x${a}x${b}x"; } Added: head/tools/regression/bin/sh/builtins/read4.0.stdout ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/read4.0.stdout Wed Sep 8 20:35:43 2010 (r212339) @@ -0,0 +1,8 @@ +xa bxcx +xaxb cx +xa:bxcx +xaxb:cx +x\xax +x\xax +x\ axx +x\:axx