* scripts/cpp: Test the exit status from 'type', not 'awk'.
2001-12-05 Geoff Keating <geoffk@redhat.com>
+ * scripts/cpp: Test the exit status from 'type', not 'awk'.
+
* sysdeps/powerpc/__longjmp.S: Don't restore FP registers.
* sysdeps/powerpc/fpu/__longjmp.S: Do restore FP registers.
* sysdeps/powerpc/setjmp.S: Don't save FP registers.
#! /bin/sh
cpp=`which cpp 2>/dev/null`
if test $? -ne 0; then
- cpp=`type cpp 2>/dev/null | awk '{ print $NF }'`
- if test $? -ne 0; then
+ if type cpp 2>/dev/null >/dev/null; then
+ cpp=`type cpp 2>/dev/null | awk '{ print $NF }'`
+ else
cpp=`gcc -print-file-name=cpp 2>/dev/null`
if test $? -ne 0; then
if test -x /lib/cpp; then