]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
(_AS_ECHO_N_PREPARE): Don't set ECHO_C to
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 23 Feb 2005 19:26:35 +0000 (19:26 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 23 Feb 2005 19:26:35 +0000 (19:26 +0000)
newline if neither \c nor -n work, as that would output two
newlines.  Prefer -n to \c.

lib/m4sugar/m4sh.m4

index 15b3405515ea30c34994cc8bc1799e7fd9ade0f3..7feeabf49e87b19f2eeffe6b9941221cda450fcb 100644 (file)
@@ -555,13 +555,17 @@ m4_define([_AS_ECHO],
 # display the checking message.  In addition, caching something used once
 # has little interest.
 # Idea borrowed from dist 3.0.  Use `*c*,', not `*c,' because if `\c'
-# failed there is also a new-line to match.
+# failed there is also a newline to match.
 m4_defun([_AS_ECHO_N_PREPARE],
-[case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='     ' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+[ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
 esac
 ])# _AS_ECHO_N_PREPARE