This patch makes it possible to use autotest on MingW32/Wine, where
DOS carriage returns are printed, breaking the testsuite (for the
record, problem was found with GNU cpio's testsuite).

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
2009-07-24  Robert Millan  <rmh.autoc...@aybabtu.com>

	Make it possible to use autotest on MingW32/Wine.

	* lib/autotest/general.m4: Use `diff --strip-trailing-cr' when
	possible.

diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4
index cf88b99..98b8116 100644
--- a/lib/autotest/general.m4
+++ b/lib/autotest/general.m4
@@ -1021,12 +1021,18 @@ else
   >"$at_devnull"
 fi
 
+at_diff=diff
+
 # Use `diff -u' when possible.
-if at_diff=`diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff"
+if at_diff_tmp=`$at_diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff_tmp"
 then
-  at_diff='diff -u'
-else
-  at_diff=diff
+  at_diff="$at_diff -u"
+fi
+
+# Use `diff --strip-trailing-cr' when possible.
+if at_diff_tmp=`$at_diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff_tmp"
+then
+  at_diff="$at_diff --strip-trailing-cr"
 fi
 
 # Get the last needed group.

Reply via email to