mirror of
https://github.com/rbenv/ruby-build.git
synced 2024-12-29 13:15:33 +01:00
Avoid array subscript error when checking OpenSSL versions
If none of Homebrew OpenSSL versions satisfy the `needs_openssl` requirement, array iteration will reach `index=-1` and that will raise a non-fatal error when accessing the `versions` array. This makes sure not to go past index=0.
This commit is contained in:
parent
281e598b07
commit
bc88537fc5
1 changed files with 1 additions and 1 deletions
|
@ -1154,7 +1154,7 @@ needs_openssl() {
|
|||
# shellcheck disable=SC2207
|
||||
versions=( $(awk '{print $2}' <<<"$brew_installs" | sort_versions) )
|
||||
local index="${#versions[@]}"
|
||||
while [ $((index--)) -ge 0 ]; do
|
||||
while [ $((--index)) -ge 0 ]; do
|
||||
homebrew_version="$(normalize_semver "${versions[index]}")"
|
||||
(( homebrew_version >= lower_bound && homebrew_version < upper_bound )) || continue
|
||||
while read -r formula version prefix; do
|
||||
|
|
Loading…
Reference in a new issue