diff --git a/ble-core.sh b/ble-core.sh index c59926c4..c48334ac 100644 --- a/ble-core.sh +++ b/ble-core.sh @@ -1478,10 +1478,10 @@ function ble-term/.initialize { _ble_term_IFS=$' \t\n' _ble_term_CR=$'\r' - if [[ $_ble_base/term.sh -nt $_ble_base_cache/$TERM.term ]]; then - source "$_ble_base/term.sh" - else + if [[ -s $_ble_base_cache/$TERM.term && $_ble_base_cache/$TERM.term -nt $_ble_base/term.sh ]]; then source "$_ble_base_cache/$TERM.term" + else + source "$_ble_base/term.sh" fi _ble_util_string_prototype.reserve "$_ble_term_it" diff --git a/ble-decode.sh b/ble-decode.sh index b73daab6..746c3ed1 100644 --- a/ble-decode.sh +++ b/ble-decode.sh @@ -1583,7 +1583,7 @@ function ble-decode-bind/cmap/initialize { local init=$_ble_base/cmap/default.sh local dump=$_ble_base_cache/cmap+default.$_ble_decode_kbd_ver.$TERM.dump - if [[ $dump -nt $init ]]; then + if [[ -s $dump && $dump -nt $init ]]; then source "$dump" else echo 'ble.sh: generating "'"$dump"'"...' 1>&2 @@ -1604,7 +1604,7 @@ function ble-decode-bind/cmap/initialize { # 3文字以上 bind/unbind ソースの生成 local fbinder=$_ble_base_cache/cmap+default.binder-source _ble_decode_bind_fbinder=$fbinder - if ! [[ $_ble_decode_bind_fbinder -nt $init ]]; then + if ! [[ -s $_ble_decode_bind_fbinder && $_ble_decode_bind_fbinder -nt $init ]]; then echo -n 'ble.sh: initializing multichar sequence binders... ' ble-decode-bind/cmap/.generate-binder-template >| "$fbinder" binder=ble-decode-bind/cmap/.emit-bindx source "$fbinder" >| "$fbinder.bind" @@ -1731,7 +1731,7 @@ function ble-decode-bind/.generate-source-to-unbind-default/.process { function ble-decode/bind { local file=$_ble_base_cache/ble-decode-bind.$_ble_bash.$bleopt_input_encoding.bind - [[ $file -nt $_ble_base/bind.sh ]] || source "$_ble_base/bind.sh" + [[ -s $file && $file -nt $_ble_base/bind.sh ]] || source "$_ble_base/bind.sh" # * 一時的に 'set convert-meta off' にする。 # diff --git a/keymap/emacs.sh b/keymap/emacs.sh index ad64ae7b..892b8236 100644 --- a/keymap/emacs.sh +++ b/keymap/emacs.sh @@ -244,7 +244,8 @@ function ble-decode/keymap:emacs/define { function ble-decode/keymap:emacs/initialize { local fname_keymap_cache=$_ble_base_cache/keymap.emacs - if [[ $fname_keymap_cache -nt $_ble_base/keymap/emacs.sh && + if [[ -s $fname_keymap_cache && + $fname_keymap_cache -nt $_ble_base/keymap/emacs.sh && $fname_keymap_cache -nt $_ble_base/cmap/default.sh ]]; then source "$fname_keymap_cache" && return fi diff --git a/keymap/vi.sh b/keymap/vi.sh index 6582b327..f806e629 100644 --- a/keymap/vi.sh +++ b/keymap/vi.sh @@ -6962,7 +6962,8 @@ function ble-decode/keymap:vi_cmap/define { function ble-decode/keymap:vi/initialize { local fname_keymap_cache=$_ble_base_cache/keymap.vi - if [[ $fname_keymap_cache -nt $_ble_base/keymap/vi.sh && + if [[ -s $fname_keymap_cache && + $fname_keymap_cache -nt $_ble_base/keymap/vi.sh && $fname_keymap_cache -nt $_ble_base/cmap/default.sh ]]; then source "$fname_keymap_cache" && return fi diff --git a/keymap/vi_digraph.sh b/keymap/vi_digraph.sh index 34c4e9fc..f2fb4143 100644 --- a/keymap/vi_digraph.sh +++ b/keymap/vi_digraph.sh @@ -49,7 +49,8 @@ function ble-decode/keymap:vi_digraph/define { function ble-decode/keymap:vi_digraph/initialize { local fname_keymap_cache=$_ble_base_cache/keymap.vi_digraph - if [[ $fname_keymap_cache -nt $_ble_base/keymap/vi_digraph.sh && + if [[ -s $fname_keymap_cache && + $fname_keymap_cache -nt $_ble_base/keymap/vi_digraph.sh && $fname_keymap_cache -nt $_ble_base/keymap/vi_digraph.txt ]]; then source "$fname_keymap_cache" return