Skip to content

Commit

Permalink
edit (ble/builtin/read): fix argument analysis with user-provided "IF…
Browse files Browse the repository at this point in the history
…S" in Bash 3.2
  • Loading branch information
akinomyoga committed Jan 6, 2020
1 parent 8cd1d19 commit 471aaad
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/util.sh
Expand Up @@ -270,10 +270,17 @@ else
fi

## 関数 ble/array#push arr value...
if ((_ble_bash>=30100)); then
if ((_ble_bash>=40000)); then
function ble/array#push {
builtin eval "$1+=(\"\${@:2}\")"
}
elif ((_ble_bash>=30100)); then
function ble/array#push {
# Note (workaround Bash 3.1/3.2 bug): #D1198
# 何故か a=("${@:2}") は IFS に特別な物が設定されていると
# "${*:2}" と同じ振る舞いになってしまう。
IFS=$' \t\n' builtin eval "$1+=(\"\${@:2}\")"
}
else
function ble/array#push {
while (($#>=2)); do
Expand Down

0 comments on commit 471aaad

Please sign in to comment.