Long overdue fix: correctly process arguments with spaces.

This commit is contained in:
Maxim Sobolev 2002-02-02 22:24:20 +00:00
parent af543e82b6
commit 1773476e67
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=54146
2 changed files with 4 additions and 5 deletions

View File

@ -8,7 +8,7 @@
#
PORTNAME= javavmwrapper
PORTVERSION= 1.3
PORTVERSION= 1.4
CATEGORIES= java
MASTER_SITES= # none
DISTFILES= # none

View File

@ -19,14 +19,13 @@
#
# MAINTAINER= sobomax@FreeBSD.org
ARGS="${*}"
PREFIX="%%PREFIX%%"
CONF="${PREFIX}/etc/javavms"
IAM=`basename "${0}"`
tryrunVM () {
if [ -x "${1}" ]; then
exec "${1}" ${2}
exec "${@}"
fi
/bin/echo "${IAM}: warning: couldn't start specified JavaVM - \"${1}\"" >&2
@ -102,7 +101,7 @@ unset JAVA_HOME
# First check if JAVAVM environment variable is set
if [ x"${JAVAVM}" != x"" ]; then
tryrunVM "${JAVAVM}" "${ARGS}"
tryrunVM "${JAVAVM}" "${@}"
fi
# Then try to make sure that ${CONF} exists
@ -116,7 +115,7 @@ VMS=`/usr/bin/sed 's|#.*||' < "${CONF}" | uniq`
# Finally try to run one of the ${VMS}
for JAVAVM in ${VMS}; do
tryrunVM "${JAVAVM}" "${ARGS}";
tryrunVM "${JAVAVM}" "${@}";
done
echo "${IAM}: error: no suitable JavaVMs found" >&2