[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
tests: fix unindent to use printf not echo for script.
From: |
Ralf Wildenhues |
Subject: |
tests: fix unindent to use printf not echo for script. |
Date: |
Tue, 22 Mar 2011 07:19:55 +0100 |
User-agent: |
Mutt/1.5.20 (2010-08-04) |
I'm applying this patch in a new bugfix branch on top of
v1.11-316-g78992b3 to fix roughly 50 new testsuite failures
when /bin/sh is dash or Solaris sh, and merging to maint,
branch-1.11 and master as appropriate.
This is a bit of a stop-gap, as it would be nicer to have an echo
function or so, but that sort of solution does not commutate with the
changes towards using a better shell for tests, and anyway would only be
for efficiency: nowadays printf is always available (it might just be
buggy).
Cheers,
Ralf
tests: fix unindent to use printf not echo for script.
* tests/defs: Use printf rather than echo, as the latter may
interpret the backslashes in the sed script. Fixes test
failures with dash as /bin/sh.
diff --git a/tests/defs b/tests/defs
index cf0b495..f6237d3 100644
--- a/tests/defs
+++ b/tests/defs
@@ -170,7 +170,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+"$@"}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- tests: fix unindent to use printf not echo for script.,
Ralf Wildenhues <=