Skip to content

Commit

Permalink
global: work around bash-4.2 bug of "declare -gA"
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Jul 9, 2022
1 parent 787ff57 commit a2ace44
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ble-decode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ ble_decode_MaskFlag=0x7FC00000

ble_decode_IsolatedESC=$((0x07FF))

if ((_ble_bash>=40200||_ble_bash>=40000&&!_ble_bash_loaded_in_function)); then
if ((_ble_bash>=40300||_ble_bash>=40000&&!_ble_bash_loaded_in_function)); then
_ble_decode_kbd_ver=4
_ble_decode_kbd__n=0
if ((_ble_bash>=40200)); then
if ((_ble_bash>=40300)); then
declare -gA _ble_decode_kbd__k2c
else
declare -A _ble_decode_kbd__k2c
Expand Down
4 changes: 2 additions & 2 deletions ble-syntax-lazy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ fi
#------------------------------------------------------------------------------
# グローバル変数の定義 (関数内からではできないのでここで先に定義)

if ((_ble_bash>=40200||_ble_bash>=40000&&!_ble_bash_loaded_in_function)); then
if ((_ble_bash>=40200)); then
if ((_ble_bash>=40300||_ble_bash>=40000&&!_ble_bash_loaded_in_function)); then
if ((_ble_bash>=40300)); then
declare -gA _ble_syntax_highlight_filetype=()
else
declare -A _ble_syntax_highlight_filetype=()
Expand Down
2 changes: 1 addition & 1 deletion lib/core-syntax.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4534,7 +4534,7 @@ function ble-syntax/highlight/cmdtype2 {
## @param[in] word
## シェル展開・クォート除去を実行する前の文字列を指定します。
## @var[out] type
if ((_ble_bash>=40200||_ble_bash>=40000&&!_ble_bash_loaded_in_function)); then
if ((_ble_bash>=40300||_ble_bash>=40000&&!_ble_bash_loaded_in_function)); then
# Note: 連想配列 _ble_syntax_highlight_filetype は ble-syntax-lazy.sh で先に定義される。

_ble_syntax_highlight_filetype_version=-1
Expand Down

0 comments on commit a2ace44

Please sign in to comment.