From: Rainer Orth Date: Mon, 6 Dec 2010 16:12:37 +0000 (+0000) Subject: run_acats (which): Assign output to temporary variable, only use if successful. X-Git-Tag: releases/gcc-4.4.6~237 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00420c92cc89d9a1397f11be405ff3fe39edf3d0;p=thirdparty%2Fgcc.git 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: r167501 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fec8325b1bf3..d4d6d82075a1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2010-12-06 Rainer Orth + + * 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 Ira Rosen diff --git a/gcc/testsuite/ada/acats/run_acats b/gcc/testsuite/ada/acats/run_acats index 9a9bdc2a3181..8f4852465dca 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 }