Skip to content

Commit

Permalink
util (ble/util/readfile): fix a bug of always exiting with 1 in "bash…
Browse files Browse the repository at this point in the history
… <= 3.2"
  • Loading branch information
akinomyoga committed Jun 19, 2022
1 parent 79efd42 commit 51d244a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/util.sh
Expand Up @@ -1005,7 +1005,10 @@ if ((_ble_bash>=40000)); then
}
else
function ble/util/readfile { # 465ms for man bash
TMOUT= IFS= builtin read -r -d '' "$1" < "$2"
[[ -r $2 && ! -d $2 ]] || return 1
local TMOUT= 2>/dev/null # #D1630 WA readonly TMOUT
IFS= builtin read "${_ble_bash_tmout_wa[@]}" -r -d '' "$1" < "$2"
return 0
}
function ble/util/mapfile {
local IFS= TMOUT=
Expand Down

0 comments on commit 51d244a

Please sign in to comment.