remove some uses of $IFS

This is a step towards resolving issue #4156. It replaces uses of `$IFS`
with other solutions.
This commit is contained in:
Kurtis Rader 2017-07-24 20:45:43 -07:00
parent 8e87d595b7
commit 0745f7dbe7
2 changed files with 7 additions and 6 deletions

View File

@ -29,13 +29,13 @@ function _echo_var --no-scope-shadowing -d '_echo_var varname [guardval]'
case 0
echo "\$$var has no value"
case 1
set -l IFS ''
echo "\$$var:" (_quote $$var)
_quote $$var | read -l x
echo "\$$var: $x"
case \*
echo "\$$var:"
for i in (seq (count $$var))
set -l IFS ''
echo "$i:" (_quote $$var[1][$i])
_quote $$var[1][$i] | read -l x
echo "$i: $x"
end
end
if set -q argv[2]; echo "@/GUARD:$argv[2]@"; end

View File

@ -35,8 +35,9 @@ if not set -q __fish_is_running_tests
end
begin
set -l IFS # clear IFS so cmd substitution doesn't split
cd (dirname $script); or die
dirname $script | read -l dir
cd $dir
or die
end
set -lx XDG_DATA_HOME ../test/data