commit bash-20190215 snapshot

This commit is contained in:
Chet Ramey
2019-02-18 09:56:34 -05:00
parent 439b8c2c5f
commit be4078d25f
56 changed files with 12464 additions and 5238 deletions
+4 -1
View File
@@ -667,6 +667,9 @@ prependå
Ã¥
ḅć
ḅć
HELLO;1 foo;2 foo;
PASS;1 foo;2 foo;
after: PASS
argv[1] = </>
argv[1] = </>
./new-exp.tests: line 615: ABXD: parameter unset
./new-exp.tests: line 618: ABXD: parameter unset
+3
View File
@@ -604,6 +604,9 @@ ${THIS_SH} ./new-exp10.sub
# parameter substring replacement and removal operators with multibyte chars
${THIS_SH} ./new-exp11.sub
# indirect expansion with arrays and local variables
${THIS_SH} ./new-exp12.sub
# problems with stray CTLNUL in bash-4.0-alpha
unset a
a=/a
+28
View File
@@ -0,0 +1,28 @@
#!/bin/bash
#
# make sure indirect expansion for arrays uses the closest-scope instance
# of the resulting variable name
array_1=("PASS")
array_2=("1 foo" "2 foo")
unsafe_fn ()
{
local array_1=('HELLO')
local a=("${!1}") b=("${!2}")
printf '%s;' "${a[@]}" "${b[@]}"
printf '\n'
}
safe_fn ()
{
local a=("${!1}") b=("${!2}")
local array_1=('FAIL')
printf '%s;' "${a[@]}" "${b[@]}"
printf '\n'
}
unsafe_fn 'array_1[@]' 'array_2[@]'
safe_fn 'array_1[@]' 'array_2[@]'
echo after: ${array_1[@]}