From c7d9a5a4939a2b3cc188117a9ec70d6090034843 Mon Sep 17 00:00:00 2001 From: amos Date: Sun, 11 Feb 2024 13:16:16 +0200 Subject: [PATCH] - removed the ASCII prefix (unneeded for the -mini version) - fixed get_i_arr_indices() (was broken because of typo) --- posix-arrays-i-mini.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/posix-arrays-i-mini.sh b/posix-arrays-i-mini.sh index 8229829..dd8581f 100644 --- a/posix-arrays-i-mini.sh +++ b/posix-arrays-i-mini.sh @@ -21,7 +21,7 @@ get_i_arr_indices() { _arr_name="$1" _out_var="$2" _check_vars "$_arr_name" "$_out_var" || return 1 - eval "_indices=\"\${_i_${_arr_name}_indices}" + eval "_indices=\"\${_i_${_arr_name}_indices}\"" _indices="$(printf '%s ' $_indices)" # no quotes on purpose @@ -41,7 +41,7 @@ set_i_arr_el() { check_index || return 1 eval "_indices=\"\${_i_${_arr_name}_indices}\" - _i_${_arr_name}_${_index}"='${_el_set_flag}${___new_val}' + _i_${_arr_name}_${_index}"='${___new_val}' case "$_indices" in *"$_nl$_index"|*"$_nl$_index$_nl"* ) ;; @@ -60,7 +60,7 @@ get_i_arr_val() { _check_vars "$_arr_name" "$_out_var" || return 1 check_index || return 1 - eval "$_out_var=\"\${_i_${_arr_name}_${_index}#$_el_set_flag}\"" + eval "$_out_var=\"\$_i_${_arr_name}_${_index}\"" } @@ -83,4 +83,3 @@ set -f export LC_ALL=C ___nl=' ' -: "${_el_set_flag:="$(printf '\35')"}"