aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2011-07-05 10:22:50 +0000
committerRainer Orth <ro@gcc.gnu.org>2011-07-05 10:22:50 +0000
commit08b3c764e8096983cbede38eecf7a50818c52114 (patch)
tree93785d7be8d81519bae849a9c9d82e343bbb4e96
parent441e4f538923c55035a3c302765737238337d333 (diff)
downloadgcc-08b3c764e8096983cbede38eecf7a50818c52114.zip
gcc-08b3c764e8096983cbede38eecf7a50818c52114.tar.gz
gcc-08b3c764e8096983cbede38eecf7a50818c52114.tar.bz2
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
-rw-r--r--gcc/testsuite/ChangeLog5
-rwxr-xr-xgcc/testsuite/ada/acats/run_acats4
2 files changed, 7 insertions, 2 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d496dbc..7a4b5bb 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-07-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * ada/acats/run_acats (which): Extract last field from type -p,
+ type output only if command succeeded.
+
2011-07-04 Jason Merrill <jason@redhat.com>
* g++.dg/abi/mangle48.C: New.
diff --git a/gcc/testsuite/ada/acats/run_acats b/gcc/testsuite/ada/acats/run_acats
index 5d68e6c..c1ed39f 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
}