This is an automated email from the ASF dual-hosted git repository.

bmarwell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-wrapper.git


The following commit(s) were added to refs/heads/master by this push:
     new e16efcb  [MWRAPPER-123] hash string char-by-char for AIX's ksh 
implementation (#117)
e16efcb is described below

commit e16efcb5d429ee091f1893455120555f596faab2
Author: Benjamin Marwell <[email protected]>
AuthorDate: Mon Feb 5 09:11:46 2024 +0100

    [MWRAPPER-123] hash string char-by-char for AIX's ksh implementation (#117)
---
 maven-wrapper-distribution/src/resources/only-mvnw | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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

Reply via email to