Skip to content

Commit

Permalink
main (ble-update): fix a bug that the check of "make" does not work i…
Browse files Browse the repository at this point in the history
…n Bash 3.2
  • Loading branch information
akinomyoga committed Jan 24, 2020
1 parent 5f949e8 commit 08ced81
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ble.pp
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ function ble-update {
local MAKE=
if type gmake &>/dev/null; then
MAKE=gmake
elif type make &>/dev/null && make --version |& grep -qiF 'GNU Make'; then
elif type make &>/dev/null && make --version 2>&1 | grep -qiF 'GNU Make'; then
MAKE=make
else
ble/util/print "ble-update: GNU Make is not available." >&2
Expand Down
5 changes: 4 additions & 1 deletion lib/core-syntax.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3227,7 +3227,10 @@ function ble/syntax:bash/ctx-command/.check-delimiter-or-redirect {
fi
((i+=len))
return 0
elif local rex='^(&&|\|[|&]?)|^;(;&?|&)|^[;&]' && [[ $tail =~ $rex ]]; then
elif local rex='^(&&|\|[|&]?)|^;(;&?|&)|^[;&]'
((_ble_bash<40000)) && rex='^(&&|\|\|?)|^;(;)|^[;&]'
[[ $tail =~ $rex ]]
then
# 制御演算子 && || | & ; |& ;; ;;& ;&

if [[ $BASH_REMATCH == ';' ]]; then
Expand Down
8 changes: 8 additions & 0 deletions memo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,8 @@ bash_features

と思ったら既にソースコードの一部にも Bash 4.0 以降であるとの注記があった。

* command |& command は Bash 4.0 以降なので使えない。

bash_tips

* swap の仕方
Expand Down Expand Up @@ -2559,6 +2561,7 @@ bash_tips
- syntax: support hexadecimal literals for arithmetic expression (reported by cmplstofB) `#D1228` 90e4f35
- history: fix a bug that history append does not work with `set -C` (reported by cmplstofB) `#D1229` 604bb8b
- decode (`ble/builtin/bind`): fix widget mapping for `default_keymap=safe` `#D1234` 750a9f5
- main (ble-update): fix a bug that the check of `make` does not work in Bash 3.2 `#D1236`

Internal changes and fixes
- internal: merge subdir `test` into `memo` `#D1230` f0c38b6
Expand Down Expand Up @@ -3700,6 +3703,11 @@ bash_tips

2020-01-24

* ble-update: 実は |& は Bash 4.0 の機能だった [#D1236]
使わない様に修正した。

序でなので文法の方も bash version をチェックして処理を切り替える様にした。

* decode (ble/builtin/bind): keyseq を読む時に標準入力を見ているがこれは変 [#D1235]
#D1233 の問題を再現する過程で bind '"...": ...' を呼び出す事によって、
後々の Bash の終了に寄与することが分かった。理由は "..." を解析する為に
Expand Down

0 comments on commit 08ced81

Please sign in to comment.