tests: fix unindent to use printf not echo for script.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 21 Mar 2011 21:12:07 +0000 (22:12 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 21 Mar 2011 21:12:07 +0000 (22:12 +0100)
* tests/defs.in: Use printf rather than echo, as the latter may
interpret the backslashes in the sed script.  Fixes test
failures with dash as /bin/sh.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
tests/defs.in

index 6f67d36..18977a9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-03-21  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       tests: fix unindent to use printf not echo for script.
+       * tests/defs.in: Use printf rather than echo, as the latter may
+       interpret the backslashes in the sed script.  Fixes test
+       failures with dash as /bin/sh.
+
 2011-03-01  Peter Rosin  <peda@lysator.liu.se>
 
        test defs: unindent without temporary file
index 2685112..fb57dfd 100644 (file)
@@ -464,7 +464,7 @@ commented_sed_unindent_prog='
 unindent ()
 {
   if test x"$sed_unindent_prog" = x; then
-    sed_unindent_prog=`echo "$commented_sed_unindent_prog" | sed -e "s/  *# .*//"`
+    sed_unindent_prog=`printf '%s\n' "$commented_sed_unindent_prog" | sed -e "s/  *# .*//"`
   fi
   sed "$sed_unindent_prog" ${1+"$@"}
 }