+# Arrange not to let diff or cmp operate on /dev/null,
+# since on some systems (at least OSF/1 5.1), that doesn't work.
+# When there are not two arguments, or no argument is /dev/null, return 2.
+# When one argument is /dev/null and the other is not empty,
+# cat the nonempty file to stderr and return 1.
+# Otherwise, return 0.
+compare_dev_null_ ()
+{
+ test $# = 2 || return 2
+
+ if test "x$1" = x/dev/null; then
+ set dummy "$2" "$1"; shift
+ fi
+
+ test "x$2" = x/dev/null || return 2
+
+ test -s "$1" || return 0
+
+ cat - "$1" <<EOF >&2
+Unexpected contents of $1:
+EOF
+ return 1
+}
+