From: Dirk Mueller Date: Fri, 5 Dec 2003 16:39:42 +0000 (+0000) Subject: allow absolute paths to be specified when "which" is not found. X-Git-Tag: svn/VALGRIND_2_1_0~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=16176a8f00a76080a60178d4be01b35b5c2659d7;p=thirdparty%2Fvalgrind.git allow absolute paths to be specified when "which" is not found. CCMAIL: 69140-done@bugs.kde.org git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2095 --- diff --git a/coregrind/valgrind.in b/coregrind/valgrind.in index 71033ec0f1..9115491b9e 100755 --- a/coregrind/valgrind.in +++ b/coregrind/valgrind.in @@ -109,7 +109,11 @@ if [ $# != 0 ] ; then # Ensure the program exists. Ignore any error messages from 'which'. which_prog=`which $1 2> /dev/null` - if [ z$which_prog = z ] ; then + if [ z$which_prog = z ] && (echo "$1" | grep -q '/'); then + which_prog=$1 + fi + + if [ z$which_prog = z ]; then echo "$0: '$1' not found in \$PATH, aborting." exit fi