]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sh: Do tilde expansion in substitutions.
authorJilles Tjoelker <jilles@FreeBSD.org>
Sat, 3 Apr 2010 22:04:44 +0000 (22:04 +0000)
committerJilles Tjoelker <jilles@FreeBSD.org>
Sat, 3 Apr 2010 22:04:44 +0000 (22:04 +0000)
commit634e9188afb5156b0b5885d36640770536d5f19c
tree1e39cf9c1a6ff2cc7d02b45795a1ca4b3b2a5960
parent5cada825b4d5a746ce99ffa2aedadef8948aca5c
sh: Do tilde expansion in substitutions.

This applies to word in ${v-word}, ${v+word}, ${v=word}, ${v?word} (which
inherits quoting from the outside) and in ${v%word}, ${v%%word}, ${v#word},
${v##word} (which does not inherit any quoting).

In all cases tilde expansion is only attempted at the start of word, even if
word contains spaces. This agrees with POSIX and other shells.

This is the last part of the patch tested in the exp-run.

Exp-run done by: erwin (with some other sh(1) changes)
bin/sh/expand.c
tools/regression/bin/sh/expansion/tilde2.0 [new file with mode: 0644]