From 0745f7dbe795feee5afa62eba23140e1a9386797 Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Mon, 24 Jul 2017 20:45:43 -0700 Subject: [PATCH] remove some uses of `$IFS` This is a step towards resolving issue #4156. It replaces uses of `$IFS` with other solutions. --- tests/interactive.config | 8 ++++---- tests/test_util.fish | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/interactive.config b/tests/interactive.config index ee6fee949..d472f3e65 100644 --- a/tests/interactive.config +++ b/tests/interactive.config @@ -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 diff --git a/tests/test_util.fish b/tests/test_util.fish index 97af65129..a4ad356bc 100644 --- a/tests/test_util.fish +++ b/tests/test_util.fish @@ -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