rmannibucau commented on code in PR #117: URL: https://github.com/apache/maven-wrapper/pull/117#discussion_r1473937034
########## maven-wrapper-distribution/src/resources/only-mvnw: ########## @@ -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 )) Review Comment: dont think we can do that due to next line which mutate str so str is not a constant in the loop, it shifts the first ascii char one by one so I guess a better fix is to use the substitution so do a substring of 1 char to let all shell handle the "string to char" (`'`) conversion working -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org