From a35ac92ef8e600b8202d231ebf64c3a0bdf6bb65 Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Mon, 22 Apr 2002 22:26:51 +0000 Subject: [PATCH] Deal properly with client arguments with spaces in. (Aharon Robbins). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@118 --- coregrind/valgrind.in | 15 ++++----------- valgrind.in | 15 ++++----------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/coregrind/valgrind.in b/coregrind/valgrind.in index 40bb6c959d..d16b5d9664 100755 --- a/coregrind/valgrind.in +++ b/coregrind/valgrind.in @@ -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 "$@" diff --git a/valgrind.in b/valgrind.in index 40bb6c959d..d16b5d9664 100755 --- a/valgrind.in +++ b/valgrind.in @@ -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 "$@" -- 2.47.2