Skip to content

Commit

Permalink
[MWRAPPER-123] replace bogus printf %d with constant 104 for now
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarwell committed Feb 1, 2024
1 parent b3e409b commit 76154c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion maven-wrapper-distribution/src/resources/only-mvnw
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ set_java_home() {
hash_string() {
str="${1:-}" h=0
while [ -n "$str" ]; do
h=$(( ( h * 31 + $(LC_CTYPE=C printf %d "'$str") ) % 4294967296 ))
# TODO: convert the input 'str' to an int for hash calculation
# printf '%d' will only convert the first character, and breaks on some ksh implementations.
h=$(( ( h * 31 + 104 ) % 4294967296 ))
str="${str#?}"
done
printf %x\\n $h
Expand Down

0 comments on commit 76154c8

Please sign in to comment.