Date: Fri, 29 Oct 2010 13:42:18 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: cvs-src-old@freebsd.org 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 Message-ID: <201010291342.o9TDgm7Y057841@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010291342.o9TDgm7Y057841>