* Eric Blake wrote on Sun, Nov 23, 2008 at 03:26:41PM CET: > According to Ralf Wildenhues on 11/23/2008 1:10 AM: > > Are we certain enough no bash or zsh version has problems with a long > > format string? > > I'm not certain they are bug-free on all possible formats (for example, > printf %100000s\\n), but for our usage, they do just fine on long strings > where Solaris /bin/printf does not.
OK, let's leave it at that for now. > Still not enough. Solaris /bin/sh correctly fails this test. However, > because we did not check for print, Solaris ksh _also_ fails the test, and > we end up wrongly favoring /bin/sh, even though it lacks a builtin. On > Solaris, we _want_ to choose ksh over /bin/sh, because builtin print is > faster than the here-doc fallback used in /bin/sh. I think the last line > has to be: > > ( PATH=/empty FPATH=/empty; export PATH FPATH > test "X`printf %s $ECHO`" = "X$ECHO" \ > || test "X`print -r -- $ECHO`" = "X$ECHO" ) }])]) Thanks for testing. I've pushed this now. Cheers, Ralf 2008-11-23 Ralf Wildenhues <[EMAIL PROTECTED]> Eric Blake <[EMAIL PROTECTED]> Fix $ECHO test to not influence other _AS_DETECT_SUGGESTED code. * libltdl/m4/libtool.m4 (_LT_PROG_ECHO_BACKSLASH): Fix test to not influence further tests registered with _AS_DETECT_SUGGESTED and do not use a PATH below /tmp, to avoid influence by a third party. diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4 index 633d8f8..5d1a131 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -1114,12 +1114,13 @@ esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - PATH=/tmp/nonexistent; export PATH; - FPATH=$PATH; export FPATH; - test "X`printf %s $ECHO`" = "X$ECHO"])]) + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])