@@ -35,12 +35,12 @@ parse_java_property() {
3535 export JAVA_PROPERTY_VALUE
3636}
3737
38- # Properly escape java options, dealing with whitespace, double quotes and backslashes.
39- # This accepts a string and returns the escaped list through ESCAPED_JAVA_OPTS .
40- escape_java_options () {
41- ESCAPED_JAVA_OPTS =() # return value
42- option_buffer=" " # buffer for collecting parts of an option
43- opened_quotes=0 # whether we are expecting a closing double quotes
38+ # Properly split java options, dealing with whitespace, double quotes and backslashes.
39+ # This accepts a string and returns the resulting list through SPLIT_JAVA_OPTS .
40+ split_java_options () {
41+ SPLIT_JAVA_OPTS =() # return value
42+ option_buffer=" " # buffer for collecting parts of an option
43+ opened_quotes=0 # whether we are expecting a closing double quotes
4444 for word in $1 ; do
4545 contains_quote=$( echo " $word " | sed " s/\\\\\" //g" | grep " \" " )
4646 if [[ -n " $contains_quote " ]]; then
@@ -49,7 +49,7 @@ escape_java_options() {
4949 fi
5050 if [[ $opened_quotes == 0 ]]; then
5151 # Remove all non-escaped quotes around the value
52- ESCAPED_JAVA_OPTS +=(" $(
52+ SPLIT_JAVA_OPTS +=(" $(
5353 echo " $option_buffer $word " | \
5454 sed " s/^[[:space:]]*//" | \
5555 sed " s/\([^\\ ]\)\" /\1/g" | \
@@ -66,7 +66,7 @@ escape_java_options() {
6666 echo " Java options parse error! Expecting closing double quotes." 1>&2
6767 exit 1
6868 fi
69- export ESCAPED_JAVA_OPTS
69+ export SPLIT_JAVA_OPTS
7070}
7171
7272# Put double quotes around each of the given java options that is a system property.
0 commit comments