Allow jar wrapper to take quoted arguments
Make the jar wrapper script correctly handle quoted arguments with spaces in them. Also allow JVM arguments in the form -J-XX, not just -JXX. Test: m checkbuild Change-Id: Iec5105bc390f2a12c6a4cda7f76d37585c39f520
This commit is contained in:
@@ -48,11 +48,11 @@ if [ ! -r "${jardir}/${jarfile}" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
javaOpts=""
|
declare -a javaOpts=()
|
||||||
while expr "x$1" : 'x-J' >/dev/null; do
|
while expr "x$1" : 'x-J' >/dev/null; do
|
||||||
opt=`expr "$1" : '-J\(.*\)'`
|
opt=`expr "$1" : '-J-\{0,1\}\(.*\)'`
|
||||||
javaOpts="${javaOpts} -${opt}"
|
javaOpts+=("-${opt}")
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
exec java ${javaOpts} -jar ${jardir}/${jarfile} "$@"
|
exec java "${javaOpts[@]}" -jar ${jardir}/${jarfile} "$@"
|
||||||
|
Reference in New Issue
Block a user