Skip to content

Commit

Permalink
Properly trim and set properties for RNG and encoding. Fixes #5132
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Apr 12, 2018
1 parent d493c94 commit fda229c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bin/jruby.bash
Expand Up @@ -239,11 +239,12 @@ do
if [ "${val:0:3}" = "-ea" ]; then
VERIFY_JRUBY="yes"
elif [ "${val:0:16}" = "-Dfile.encoding=" ]; then
JAVA_ENCODING=$val
JAVA_ENCODING=$val${val:16}
elif [ "${val:0:20}" = "-Djava.security.egd=" ]; then
JAVA_SECURITY_EGD=$val
JAVA_SECURITY_EGD=${val:20}
else
java_args=("${java_args[@]}" "${1:2}")
fi
java_args=("${java_args[@]}" "${1:2}")
fi
;;
# Pass -X... and -X? search options through
Expand Down Expand Up @@ -321,6 +322,8 @@ done
# Force file.encoding to UTF-8 when on Mac, since Apple JDK defaults to MacRoman (JRUBY-3576)
if [[ $darwin && -z "$JAVA_ENCODING" ]]; then
java_args=("${java_args[@]}" "-Dfile.encoding=UTF-8")
elif [[ -n "$JAVA_ENCODING" ]]; then
java_args=("${java_args[@]}" "-Dfile.encoding=$JAVA_ENCODING")
fi

# Force OpenJDK-based JVMs to use /dev/urandom for random number generation
Expand Down

0 comments on commit fda229c

Please sign in to comment.