From owner-cvs-src-old@FreeBSD.ORG Fri Oct 29 13:42:49 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 441461065670 for ; Fri, 29 Oct 2010 13:42:49 +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 157058FC21 for ; Fri, 29 Oct 2010 13:42:49 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id o9TDgmq3057842 for ; Fri, 29 Oct 2010 13:42:48 GMT (envelope-from jilles@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id o9TDgm7Y057841 for cvs-src-old@freebsd.org; Fri, 29 Oct 2010 13:42:48 GMT (envelope-from jilles@repoman.freebsd.org) Message-Id: <201010291342.o9TDgm7Y057841@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to jilles@repoman.freebsd.org using -f From: Jilles Tjoelker Date: Fri, 29 Oct 2010 13:42:18 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/bin/sh expand.c expand.h mksyntax.c parser.c parser.h src/tools/regression/bin/sh/expansion plus-minus6.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: Fri, 29 Oct 2010 13:42:49 -0000 jilles 2010-10-29 13:42:18 UTC FreeBSD src repository Modified files: bin/sh expand.c expand.h mksyntax.c parser.c parser.h Added files: tools/regression/bin/sh/expansion plus-minus6.0 Log: SVN rev 214512 on 2010-10-29 13:42:18Z by jilles sh: Do IFS splitting on word in ${v+word} and ${v-word}. The code is inspired by NetBSD sh somewhat, but different because we preserve the old Almquist/Bourne/Korn ability to have an unquoted part in a quoted ${v+word}. For example, "${v-"*"}" expands to $v as a single field if v is set, but generates filenames otherwise. Note that this is the only place where we split text literally from the script (the similar ${v=word} assigns to v and then expands $v). The parser must now add additional markers to allow the expansion code to know whether arbitrary characters in substitutions are quoted. Example: for i in ${$+a b c}; do echo $i; done Exp-run done by: pav (with some other sh(1) changes) Revision Changes Path 1.72 +27 -10 src/bin/sh/expand.c 1.14 +2 -0 src/bin/sh/expand.h 1.33 +1 -0 src/bin/sh/mksyntax.c 1.95 +12 -4 src/bin/sh/parser.c 1.15 +1 -0 src/bin/sh/parser.h 1.1 +34 -0 src/tools/regression/bin/sh/expansion/plus-minus6.0 (new)