Deal properly with client arguments with spaces in. (Aharon Robbins).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@118
This commit is contained in:
Julian Seward 2002-04-22 22:26:51 +00:00
parent cee0398714
commit a35ac92ef8
2 changed files with 8 additions and 22 deletions

View File

@ -29,8 +29,9 @@ dousage=0
doversion=0
# Collect up args for Valgrind
for arg
while [ $+ != 0 ]
do
arg=$1
case "$arg" in
# options for the user
--help) dousage=1; break;;
@ -97,20 +98,12 @@ do
esac
done
# Collect up the prog and args to run
for arg
do
case "$arg" in
*) argopts="$argopts $arg"; shift;;
esac
done
if [ z"$doversion" = z1 ]; then
echo "valgrind-$version"
exit 1
fi
if [ z"$argopts" = z -o z"$dousage" = z1 ]; then
if [ $# = 0 ] || [ z"$dousage" = z1 ]; then
echo
echo "usage: $vgname [options] prog-and-args"
echo
@ -174,4 +167,4 @@ LD_PRELOAD=valgrind.so:$LD_PRELOAD
export LD_PRELOAD
#LD_DEBUG=files
#export LD_DEBUG
exec $argopts
exec "$@"

View File

@ -29,8 +29,9 @@ dousage=0
doversion=0
# Collect up args for Valgrind
for arg
while [ $+ != 0 ]
do
arg=$1
case "$arg" in
# options for the user
--help) dousage=1; break;;
@ -97,20 +98,12 @@ do
esac
done
# Collect up the prog and args to run
for arg
do
case "$arg" in
*) argopts="$argopts $arg"; shift;;
esac
done
if [ z"$doversion" = z1 ]; then
echo "valgrind-$version"
exit 1
fi
if [ z"$argopts" = z -o z"$dousage" = z1 ]; then
if [ $# = 0 ] || [ z"$dousage" = z1 ]; then
echo
echo "usage: $vgname [options] prog-and-args"
echo
@ -174,4 +167,4 @@ LD_PRELOAD=valgrind.so:$LD_PRELOAD
export LD_PRELOAD
#LD_DEBUG=files
#export LD_DEBUG
exec $argopts
exec "$@"