better check for 'echo -n'

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1591 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
meep-eep
2005-03-18 13:08:05 +00:00
parent c1deb9fc16
commit 13b8dbfcd8
+8 -3
View File
@@ -43,7 +43,7 @@ PROG_echon_ACTION=""
PROG_echon_VERSION='' PROG_echon_VERSION=''
PROG_echon_DETECT="echon_detect" PROG_echon_DETECT="echon_detect"
echon_detect() { echon_detect() {
local TEST local TEST LOCATIONS LOCATION
# Default echo (probably builtin) # Default echo (probably builtin)
TEST=`echo -n X` TEST=`echo -n X`
@@ -53,11 +53,16 @@ echon_detect() {
fi fi
# External echo # External echo
TEST=`/bin/echo -n X` LOCATIONS="/bin/ /usr/ucb/"
for LOCATION in $LOCATIONS; do
if [ -x ${LOCATION}echo ]; then
TEST=`${LOCATION}echo -n X`
if [ "$TEST" = X ]; then if [ "$TEST" = X ]; then
PROG_echon_FILE="/bin/echo -n" PROG_echon_FILE="${LOCATION}echo -n"
return 0; return 0;
fi fi
fi
done
# Using printf as echo # Using printf as echo
TEST=`printf %s X` TEST=`printf %s X`