diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2010-12-06 16:09:19 +0000 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2010-12-06 16:09:19 +0000 |
commit | 3ff4c5d9a3f08689f4ced275c8c2e5fc254ae7ce (patch) | |
tree | 11f367ba04380cfe5f753df862fb65ed4824e41d /gcc/testsuite/ada/acats | |
parent | 258e15e073c181d9c880cdaf59fdef9755aa6a4c (diff) | |
download | gcc-3ff4c5d9a3f08689f4ced275c8c2e5fc254ae7ce.zip gcc-3ff4c5d9a3f08689f4ced275c8c2e5fc254ae7ce.tar.gz gcc-3ff4c5d9a3f08689f4ced275c8c2e5fc254ae7ce.tar.bz2 |
run_acats (which): Assign output to temporary variable, only use if successful.
* ada/acats/run_acats (which): Assign output to temporary
variable, only use if successful.
Use last field of type output.
From-SVN: r167499
Diffstat (limited to 'gcc/testsuite/ada/acats')
-rwxr-xr-x | gcc/testsuite/ada/acats/run_acats | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/testsuite/ada/acats/run_acats b/gcc/testsuite/ada/acats/run_acats index cf6b428..bb68e62 100755 --- a/gcc/testsuite/ada/acats/run_acats +++ b/gcc/testsuite/ada/acats/run_acats @@ -14,9 +14,9 @@ fi # Fall back to whence which ksh88 and ksh93 provide, but bash does not. which () { - type -p $* 2>/dev/null && return 0 - type $* 2>/dev/null | awk '{print $3}' && return 0 - whence $* 2>/dev/null && return 0 + path=`type -p $* 2>/dev/null` && { echo $path; return 0; } + path=`type $* 2>/dev/null | awk '{print $NF}'` && { echo $path; return 0; } + path=`whence $* 2>/dev/null` && { echo $path; return 0; } return 1 } |