]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
run_acats (which): Assign output to temporary variable, only use if successful.
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Mon, 6 Dec 2010 16:12:37 +0000 (16:12 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Mon, 6 Dec 2010 16:12:37 +0000 (16:12 +0000)
* ada/acats/run_acats (which): Assign output to temporary
variable, only use if successful.
Use last field of type output.

From-SVN: r167501

gcc/testsuite/ChangeLog
gcc/testsuite/ada/acats/run_acats

index fec8325b1bf30d4cc4c2c235be802f1b7f9fd322..d4d6d82075a1de1440041f65d3a191a9a5602387 100644 (file)
@@ -1,3 +1,9 @@
+2010-12-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * ada/acats/run_acats (which): Assign output to temporary
+       variable, only use if successful.
+       Use last field of type output.
+
 2010-12-05  Richard Guenther  <rguenther@suse.de>
            Ira Rosen  <irar@il.ibm.com>
 
index 9a9bdc2a3181cf32effa409f6fe977ea36ed3cc8..8f4852465dcabbeb44f3fd41c125d3c6e3d97aa7 100755 (executable)
@@ -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
 }