diff --git a/maven-wrapper-distribution/src/resources/only-mvnw b/maven-wrapper-distribution/src/resources/only-mvnw index e9c85c8..6620a5c 100755 --- a/maven-wrapper-distribution/src/resources/only-mvnw +++ b/maven-wrapper-distribution/src/resources/only-mvnw @@ -82,7 +82,8 @@ set_java_home() { hash_string() { str="${1:-}" h=0 while [ -n "$str" ]; do - h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$str")) % 4294967296)) + char="${str%"${str#?}"}" + h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) str="${str#?}" done printf %x\\n $h