From 53f893d0626f2d683f6da229301c5dbb75d8dbe8 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sun, 12 Feb 2012 20:27:48 +0000 Subject: 30181, plus rename of PF_* flags to PREFORK_*: Pass sh-wordsplitting instructions to paramsubst() using flags, avoiding side effects of explicitly setting and unsetting the SHWORDSPLIT option. --- Test/D04parameter.ztst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Test/D04parameter.ztst') diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst index 71c79687f..69606e453 100644 --- a/Test/D04parameter.ztst +++ b/Test/D04parameter.ztst @@ -255,6 +255,20 @@ >two >words + (setopt shwordsplit # ensure this doesn't get set in main shell... + test_splitting () + { + array="one two three" + for e in $array; do + echo "'$e'" + done + } + test_split_var= + : ${test_split_var:=$(test_splitting)} + echo "_${test_split_var}_") +0:SH_WORD_SPLIT inside $(...) inside ${...} +>_'one' 'two' 'three'_ + print -l "${(f)$(print first line\\nsecond line\\nthird line)}" 0:${(f)$(...)} >first line -- cgit 1.4.1