From 3981b644d68f6b6947b4a12810c2fa5e09da4e58 Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Wed, 20 Aug 2014 21:19:08 -0700 Subject: Fix double expansions (`$$foo`) Double expansions of variables had the following issues: * `"$$foo"` threw an error no matter what the value of `$foo` was. * `set -l foo ''; echo $$foo` threw an error because of the expansion of `$foo` to `''`. With this change, double expansion always works properly. When double-expanding a multi-valued variable, in a double-quoted string the first word of the inner expansion is used for the outer expansion, and outside of a quoted string every word is used for the double-expansion in each of the arguments. > set -l foo bar baz > set -l bar one two > set -l baz three four > echo "$$foo" one two baz > echo $$foo one two three four --- tests/top.out | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/top.out') diff --git a/tests/top.out b/tests/top.out index 768526c6..acf52d42 100644 --- a/tests/top.out +++ b/tests/top.out @@ -1,4 +1,5 @@ Testing high level script functionality +File expansion.in tested ok File printf.in tested ok File test1.in tested ok File test2.in tested ok -- cgit v1.2.3