Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 76154c8

Browse files
committed
[MWRAPPER-123] replace bogus printf %d with constant 104 for now
1 parent b3e409b commit 76154c8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • maven-wrapper-distribution/src/resources

maven-wrapper-distribution/src/resources/only-mvnw

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ set_java_home() {
7272
hash_string() {
7373
str="${1:-}" h=0
7474
while [ -n "$str" ]; do
75-
h=$(( ( h * 31 + $(LC_CTYPE=C printf %d "'$str") ) % 4294967296 ))
75+
# TODO: convert the input 'str' to an int for hash calculation
76+
# printf '%d' will only convert the first character, and breaks on some ksh implementations.
77+
h=$(( ( h * 31 + 104 ) % 4294967296 ))
7678
str="${str#?}"
7779
done
7880
printf %x\\n $h

0 commit comments

Comments
 (0)