[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 6/6] use print or printf or cat as $ECHO (really)
From: |
Ralf Wildenhues |
Subject: |
Re: [PATCH 6/6] use print or printf or cat as $ECHO (really) |
Date: |
Sun, 23 Nov 2008 15:40:25 +0100 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
* 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 <address@hidden>
Eric Blake <address@hidden>
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])
- Re: [PATCH 6/6] use print or printf or cat as $ECHO (really), (continued)
- Re: [PATCH 6/6] use print or printf or cat as $ECHO (really), Ralf Wildenhues, 2008/11/22
- Re: [PATCH 6/6] use print or printf or cat as $ECHO (really), Paolo Bonzini, 2008/11/22
- Re: [PATCH 6/6] use print or printf or cat as $ECHO (really), Eric Blake, 2008/11/22
- Re: [PATCH 6/6] use print or printf or cat as $ECHO (really), Eric Blake, 2008/11/22
- Re: [PATCH 6/6] use print or printf or cat as $ECHO (really), Ralf Wildenhues, 2008/11/23
- Re: [PATCH 6/6] use print or printf or cat as $ECHO (really), Eric Blake, 2008/11/23
- Re: [PATCH 6/6] use print or printf or cat as $ECHO (really),
Ralf Wildenhues <=
- Re: [PATCH 6/6] use print or printf or cat as $ECHO, Eric Blake, 2008/11/10
- Re: [PATCH 6/6] use printf as $ECHO, Eric Blake, 2008/11/10
- Re: [PATCH 6/6] use printf as $ECHO, Ralf Wildenhues, 2008/11/10
- Re: [PATCH 6/6] use printf as $ECHO, Sven Mascheck, 2008/11/10
- Re: [PATCH 6/6] use printf as $ECHO, Ralf Wildenhues, 2008/11/11