mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 05:28:49 +00:00
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:
parent
8e87d595b7
commit
0745f7dbe7
2 changed files with 7 additions and 6 deletions
|
@ -29,13 +29,13 @@ function _echo_var --no-scope-shadowing -d '_echo_var varname [guardval]'
|
||||||
case 0
|
case 0
|
||||||
echo "\$$var has no value"
|
echo "\$$var has no value"
|
||||||
case 1
|
case 1
|
||||||
set -l IFS ''
|
_quote $$var | read -l x
|
||||||
echo "\$$var:" (_quote $$var)
|
echo "\$$var: $x"
|
||||||
case \*
|
case \*
|
||||||
echo "\$$var:"
|
echo "\$$var:"
|
||||||
for i in (seq (count $$var))
|
for i in (seq (count $$var))
|
||||||
set -l IFS ''
|
_quote $$var[1][$i] | read -l x
|
||||||
echo "$i:" (_quote $$var[1][$i])
|
echo "$i: $x"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if set -q argv[2]; echo "@/GUARD:$argv[2]@"; end
|
if set -q argv[2]; echo "@/GUARD:$argv[2]@"; end
|
||||||
|
|
|
@ -35,8 +35,9 @@ if not set -q __fish_is_running_tests
|
||||||
end
|
end
|
||||||
|
|
||||||
begin
|
begin
|
||||||
set -l IFS # clear IFS so cmd substitution doesn't split
|
dirname $script | read -l dir
|
||||||
cd (dirname $script); or die
|
cd $dir
|
||||||
|
or die
|
||||||
end
|
end
|
||||||
|
|
||||||
set -lx XDG_DATA_HOME ../test/data
|
set -lx XDG_DATA_HOME ../test/data
|
||||||
|
|
Loading…
Reference in a new issue