Join variables by their delimiter in quoted expansion

This switches quoted expansion like "$foo" to use foo's delimiter instead of
space. The delimiter is space for normal variables and colonf or path variables.
Expansions like "$PATH" will now expand using ':'.
This commit is contained in:
ridiculousfish
2018-09-30 19:34:01 -04:00
parent 3f3b3a7006
commit 5947aa0171
9 changed files with 41 additions and 13 deletions

View File

@@ -306,8 +306,9 @@ set -gx FOOPATH one two three four
../test/root/bin/fish -c 'echo Elements in FOO and FOOPATH: (count $FOO) (count $FOOPATH)'
# some must use colon separators!
set -lx MANPATH man1 man2 man3 ; env | grep '^MANPATH='
# ensure we don't escape colon values
# ensure we don't escape space and colon values
set -x DONT_ESCAPE_COLONS 1: 2: :3: ; env | grep '^DONT_ESCAPE_COLONS='
set -x DONT_ESCAPE_SPACES '1 ' '2 ' ' 3 ' 4 ; env | grep '^DONT_ESCAPE_SPACES='
set -x DONT_ESCAPE_COLONS_PATH 1: 2: :3: ; env | grep '^DONT_ESCAPE_COLONS_PATH='
true