From owner-cvs-src-old@FreeBSD.ORG Sat Apr 3 20:58:34 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4FB3106566B for ; Sat, 3 Apr 2010 20:58:34 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id B15208FC13 for ; Sat, 3 Apr 2010 20:58:34 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o33KwYWG018664 for ; Sat, 3 Apr 2010 20:58:34 GMT (envelope-from jilles@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o33KwYvl018663 for cvs-src-old@freebsd.org; Sat, 3 Apr 2010 20:58:34 GMT (envelope-from jilles@repoman.freebsd.org) Message-Id: <201004032058.o33KwYvl018663@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to jilles@repoman.freebsd.org using -f From: Jilles Tjoelker Date: Sat, 3 Apr 2010 20:55:56 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/bin/sh parser.c src/tools/regression/bin/sh/expansion plus-minus2.0 src/tools/regression/bin/sh/parser heredoc2.0 X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Apr 2010 20:58:34 -0000 jilles 2010-04-03 20:55:56 UTC FreeBSD src repository Modified files: bin/sh parser.c Added files: tools/regression/bin/sh/expansion plus-minus2.0 tools/regression/bin/sh/parser heredoc2.0 Log: SVN rev 206145 on 2010-04-03 20:55:56Z by jilles sh: Fix various things about expansions: * remove the backslash from \} inside double quotes inside +-=? substitutions, e.g. "${$+\}a}" * maintain separate double-quote state for ${v#...} and ${v%...}; single and double quotes are special inside, even in a double-quoted string or here document * keep track of correct order of substitutions and arithmetic This is different from dash's approach, which does not track individual double quotes in the parser, trying to fix this up during expansion. This treats single quotes inside "${v#...}" incorrectly, however. This is similar to NetBSD's approach (as submitted in PR bin/57554), but recognizes the difference between +-=? and #% substitutions hinted at in POSIX and is more refined for arithmetic expansion and here documents. PR: bin/57554 Exp-run done by: erwin (with some other sh(1) changes) Revision Changes Path 1.76 +208 -73 src/bin/sh/parser.c 1.1 +4 -0 src/tools/regression/bin/sh/expansion/plus-minus2.0 (new) 1.1 +44 -0 src/tools/regression/bin/sh/parser/heredoc2.0 (new)