From: Paul Eggert Date: Fri, 1 Dec 2006 18:32:34 +0000 (+0000) Subject: * lib/m4sugar/m4sh.m4 (_AS_ECHO_PREPARE): Use a longer test X-Git-Tag: AUTOCONF-2.61a~26 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d7884b4e294ee48f4ebe9e1462a9119dac2dfc07;p=thirdparty%2Fautoconf.git * lib/m4sugar/m4sh.m4 (_AS_ECHO_PREPARE): Use a longer test string for more reliable failure. Wrap the entire test that causes the broken Solaris printf to dump core, in a subshell, so the segmentation fault message is reliably suppressed. Fix shell expansion errors by using /usr/ucb/echo always; avoid an error on systems without it by another subshell. Avoid m4 expansion of `$1'. Set the zeroth argument of the subshell-$as_echo to `as_echo', for better error message. --- diff --git a/ChangeLog b/ChangeLog index 79e3ac062..8a8c9cd5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-12-01 Ralf Wildenhues + + * lib/m4sugar/m4sh.m4 (_AS_ECHO_PREPARE): Use a longer test + string for more reliable failure. Wrap the entire test that + causes the broken Solaris printf to dump core, in a subshell, + so the segmentation fault message is reliably suppressed. + Fix shell expansion errors by using /usr/ucb/echo always; + avoid an error on systems without it by another subshell. + Avoid m4 expansion of `$1'. Set the zeroth argument of the + subshell-$as_echo to `as_echo', for better error message. + 2006-11-28 Ralf Wildenhues * lib/autoconf/general.m4 (_AC_CACHE_DUMP): If `BASH_ARGV' or diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4 index 88db41908..30ee5f9de 100644 --- a/lib/m4sugar/m4sh.m4 +++ b/lib/m4sugar/m4sh.m4 @@ -808,21 +808,21 @@ m4_defun([_AS_ECHO_PREPARE], [[as_nl=' ' export as_nl -# Printing a 2060-byte string crashes Solaris 7 /usr/bin/printf. +# Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo -if test "X`(printf %s $as_echo) 2>/dev/null`" = "X$as_echo"; then +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else - if test "X`PATH=/usr/ucb; echo -n -n $as_echo`" = "X-n $as_echo"; then - as_echo_body='PATH=/usr/ucb; eval echo -n "$1$as_nl"' + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$][1$as_nl"' as_echo_n='/usr/ucb/echo -n' else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_body='eval expr "X$][1" : "X\\(.*\\)"' as_echo_n_body='eval - arg=$1; + arg=$][1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; @@ -831,10 +831,10 @@ else expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body X' + as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body - as_echo='sh -c $as_echo_body X' + as_echo='sh -c $as_echo_body as_echo' fi ]])# _AS_ECHO_PREPARE