Merge pull request #18147 from Homebrew/shellcheck-helpers.sh

This commit is contained in:
Mike McQuaid 2024-08-26 09:17:24 +01:00 committed by GitHub
commit d58302ef6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -82,7 +82,7 @@ which() {
}
numeric() {
# Condense the exploded argument into a single return value.
# shellcheck disable=SC2086,SC2183
printf "%01d%02d%02d%03d" ${1//[.rc]/ } 2>/dev/null
local -a version_array
IFS=".rc" read -r -a version_array <<<"${1}"
printf "%01d%02d%02d%03d" "${version_array[@]}" 2>/dev/null
}