aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2019-07-11 10:59:59 -0700
committerColin Cross <ccross@android.com>2019-07-16 11:12:04 -0700
commite5cae33f5dbb3882700662a745dc9d4bdf529f16 (patch)
tree467969b12ab47644321e51280d06ab48ce0e5d22
parent0cb0d7b1c5548b763a06cb553b1adb6cb49b3930 (diff)
downloadbuild_soong-e5cae33f5dbb3882700662a745dc9d4bdf529f16.tar.gz
build_soong-e5cae33f5dbb3882700662a745dc9d4bdf529f16.tar.bz2
build_soong-e5cae33f5dbb3882700662a745dc9d4bdf529f16.zip
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
-rw-r--r--scripts/jar-wrapper.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/jar-wrapper.sh b/scripts/jar-wrapper.sh
index 71c1d906..b4680415 100644
--- a/scripts/jar-wrapper.sh
+++ b/scripts/jar-wrapper.sh
@@ -48,11 +48,11 @@ if [ ! -r "${jardir}/${jarfile}" ]; then
exit 1
fi
-javaOpts=""
+declare -a javaOpts=()
while expr "x$1" : 'x-J' >/dev/null; do
- opt=`expr "$1" : '-J\(.*\)'`
- javaOpts="${javaOpts} -${opt}"
+ opt=`expr "$1" : '-J-\{0,1\}\(.*\)'`
+ javaOpts+=("-${opt}")
shift
done
-exec java ${javaOpts} -jar ${jardir}/${jarfile} "$@"
+exec java "${javaOpts[@]}" -jar ${jardir}/${jarfile} "$@"