From 08b3c764e8096983cbede38eecf7a50818c52114 Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Tue, 5 Jul 2011 10:22:50 +0000 Subject: [PATCH] run_acats (which): Extract last field from type -p, type output only if command succeeded. * ada/acats/run_acats (which): Extract last field from type -p, type output only if command succeeded. From-SVN: r175843 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/ada/acats/run_acats | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d496dbcdb82..7a4b5bbd3f9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-07-05 Rainer Orth + + * ada/acats/run_acats (which): Extract last field from type -p, + type output only if command succeeded. + 2011-07-04 Jason Merrill * g++.dg/abi/mangle48.C: New. diff --git a/gcc/testsuite/ada/acats/run_acats b/gcc/testsuite/ada/acats/run_acats index 5d68e6c223a..c1ed39f8555 100755 --- a/gcc/testsuite/ada/acats/run_acats +++ b/gcc/testsuite/ada/acats/run_acats @@ -14,8 +14,8 @@ fi # Fall back to whence which ksh88 and ksh93 provide, but bash does not. which () { - path=`type -p $* 2>/dev/null | awk '{print $NF}'` && { echo $path; return 0; } - path=`type $* 2>/dev/null | awk '{print $NF}'` && { echo $path; return 0; } + path=`type -p $* 2>/dev/null` && { echo $path | awk '{print $NF}'; return 0; } + path=`type $* 2>/dev/null` && { echo $path | awk '{print $NF}'; return 0; } path=`whence $* 2>/dev/null` && { echo $path; return 0; } return 1 } -- 2.30.2