]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/m4sugar/m4sh.m4 (_AS_ECHO_PREPARE): Use a longer test
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 1 Dec 2006 18:32:34 +0000 (18:32 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 1 Dec 2006 18:32:34 +0000 (18:32 +0000)
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.

ChangeLog
lib/m4sugar/m4sh.m4

index 79e3ac0622ca0cc8aab734bac8a8c633934c0cc6..8a8c9cd5b7170f6acfc6310f3e66eebbf186007e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-12-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * 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  <Ralf.Wildenhues@gmx.de>
 
        * lib/autoconf/general.m4 (_AC_CACHE_DUMP): If `BASH_ARGV' or
index 88db41908a45aaaadd508968eb36a1fc13b73956..30ee5f9deb34f79ccc6e56007613ecf53b366703 100644 (file)
@@ -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