---
 eclass/eapi7-ver.eclass | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/eclass/eapi7-ver.eclass b/eclass/eapi7-ver.eclass
index 6117124a90a5..3a200cbe9ef2 100644
--- a/eclass/eapi7-ver.eclass
+++ b/eclass/eapi7-ver.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: eapi7-ver.eclass
@@ -58,12 +58,8 @@
 # the version string, it is truncated silently.
 
 case ${EAPI:-0} in
-       0|1|2|3|4|5)
-               die "${ECLASS}: EAPI=${EAPI:-0} not supported";;
-       6)
-               ;;
-       *)
-               die "${ECLASS}: EAPI=${EAPI} includes all functions from this 
eclass";;
+       0|1|2|3|4|5|6) ;;
+       *) die "${ECLASS}: EAPI=${EAPI} includes all functions from this 
eclass" ;;
 esac
 
 # @FUNCTION: _ver_parse_range
@@ -128,18 +124,22 @@ _ver_split() {
 ver_cut() {
        local range=${1}
        local v=${2:-${PV}}
-       local start end
+       local start end i out
        local -a comp
 
        _ver_split "${v}"
        local max=$((${#comp[@]}/2))
        _ver_parse_range "${range}" "${max}"
 
-       local IFS=
        if [[ ${start} -gt 0 ]]; then
                start=$(( start*2 - 1 ))
        fi
-       echo "${comp[*]:start:end*2-start}"
+       # Work around a bug in bash-3.2, where "${comp[*]:start:end*2-start}"
+       # inserts spurious 0x7f characters for empty array elements
+       for (( i = start; i < end*2; i++ )); do
+               out+=${comp[i]}
+       done
+       echo "${out}"
 }
 
 # @FUNCTION: ver_rs
-- 
2.17.0

Attachment: pgpIIUIMwuL2N.pgp
Description: PGP signature

Reply via email to