From owner-svn-src-stable-8@FreeBSD.ORG Fri May 6 12:49:32 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6EE21065670; Fri, 6 May 2011 12:49:32 +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 CC32C8FC1C; Fri, 6 May 2011 12:49:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p46CnWOe048675; Fri, 6 May 2011 12:49:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p46CnWWW048672; Fri, 6 May 2011 12:49:32 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201105061249.p46CnWWW048672@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 6 May 2011 12:49:32 +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: r221522 - in stable/8: bin/sh tools/regression/bin/sh/expansion X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2011 12:49:33 -0000 Author: jilles Date: Fri May 6 12:49:32 2011 New Revision: 221522 URL: http://svn.freebsd.org/changeset/base/221522 Log: MFC r220903: sh: Do not word split "${#parameter}". This is only a problem if IFS contains digits, which is unusual but valid. Because of an incorrect fix for PR bin/12137, "${#parameter}" was treated as ${#parameter}. The underlying problem was that "${#parameter}" erroneously added CTLESC bytes before determining the length. This was properly fixed for PR bin/56147 but the incorrect fix was not backed out. Reported by: Seeker on forums.freebsd.org Added: stable/8/tools/regression/bin/sh/expansion/length6.0 - copied unchanged from r220903, head/tools/regression/bin/sh/expansion/length6.0 Modified: stable/8/bin/sh/parser.c Directory Properties: stable/8/bin/sh/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) Modified: stable/8/bin/sh/parser.c ============================================================================== --- stable/8/bin/sh/parser.c Fri May 6 07:13:34 2011 (r221521) +++ stable/8/bin/sh/parser.c Fri May 6 12:49:32 2011 (r221522) @@ -1289,7 +1289,7 @@ parsesub: { pungetc(); } STPUTC('=', out); - if (subtype != VSLENGTH && (dblquote || arinest)) + if (dblquote || arinest) flags |= VSQUOTE; *(stackblock() + typeloc) = subtype | flags; if (subtype != VSNORMAL) Copied: stable/8/tools/regression/bin/sh/expansion/length6.0 (from r220903, head/tools/regression/bin/sh/expansion/length6.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/expansion/length6.0 Fri May 6 12:49:32 2011 (r221522, copy of r220903, head/tools/regression/bin/sh/expansion/length6.0) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +x='!@#$%^&*()[]' +[ ${#x} = 12 ] || echo bad 1 +[ "${#x}" = 12 ] || echo bad 2 +IFS=2 +[ ${#x} = 1 ] || echo bad 3 +[ "${#x}" = 12 ] || echo bad 4