change env_var_t to a vector of strings

Internally fish should store vars as a vector of elements. The current
flat string representation is a holdover from when the code was written
in C.

Fixes #4200
This commit is contained in:
Kurtis Rader
2017-08-05 15:08:39 -07:00
parent 6e02ec83d1
commit f872f25f5b
30 changed files with 503 additions and 543 deletions

View File

@@ -91,8 +91,6 @@ echo '' | read -la ary
print_vars ary
set -le IFS
# read -n tests
logmsg read -n tests
echo 'testing' | read -n 3 foo
echo $foo
@@ -106,8 +104,6 @@ echo $bar
echo 'test' | read -n 1 foo
echo $foo
# read -0 tests
logmsg read -z tests
echo -n 'testing' | read -lz foo
echo $foo

View File

@@ -301,7 +301,8 @@ env DISPLAY="localhost:0.0" ../test/root/bin/fish -c 'echo Elements in DISPLAY:
# We can't use PATH for this because the global configuration will modify PATH
# based on /etc/paths and /etc/paths.d.
# Exported arrays should use record separator, with a few exceptions. So we can use an arbitrary variable for this.
env FOO=one\x1etwo\x1ethree\x1efour ../test/root/bin/fish -c 'echo Elements in FOO: (count $FOO)'
set -gx FOO one two three four
../test/root/bin/fish -c 'echo Elements in FOO: (count $FOO)'
# some must use colon separators!
set -lx MANPATH man1 man2 man3 ; env | grep '^MANPATH='