* tests/init.sh: In testing for diff -u and diff -c, use a
stderr-redirecting exec inside `...` rather than a subshell.
2012-01-05 Jim Meyering <meyering@redhat.com>
+ init.sh: don't waste a subshell just to redirect stderr
+ * tests/init.sh: In testing for diff -u and diff -c, use a
+ stderr-redirecting exec inside `...` rather than a subshell.
+
test-init.sh: avoid failure on HP-UX 11.00
* tests/test-init.sh: Skip "diff -u"-comparing step when compare
resolves to diff -c or cmp. Reported by Bruno Haible.
return 2
}
-if diff_out_=`( diff -u "$0" "$0" < /dev/null ) 2>/dev/null`; then
+if diff_out_=`exec 2>/dev/null; diff -u "$0" "$0" < /dev/null`; then
if test -z "$diff_out_"; then
compare_ () { diff -u "$@"; }
else
fi
}
fi
-elif diff_out_=`( diff -c "$0" "$0" < /dev/null ) 2>/dev/null`; then
+elif diff_out_=`exec 2>/dev/null; diff -c "$0" "$0" < /dev/null`; then
if test -z "$diff_out_"; then
compare_ () { diff -c "$@"; }
else