]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Don't use `diff -u'. It's not portable.
authorJim Meyering <jim@meyering.net>
Mon, 25 Sep 2000 20:23:43 +0000 (20:23 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 25 Sep 2000 20:23:43 +0000 (20:23 +0000)
Run `diff -c' only if cmp finds a difference.

tests/cp/same-file

index ae077c8169786ab5fd02f3d1db23bf1fd74872c7..6752b4f0ed757dbc3a2b988e4db876a5d48d3936 100755 (executable)
@@ -182,8 +182,10 @@ cat <<\EOF > $expected
 
 EOF
 
-# Uncomment this if you see a failure and want to try to diagnose it.
-diff -u $expected $actual 1>&2
+fail=0;
 
-cmp $expected $actual
-exit $?
+# Some folks don't have diff.
+cmp $expected $actual \
+  || { diff -c $expected $actual 1>&2; fail=1; }
+
+(exit $fail); exit