From 464f9e7b25ea50440cd453931e18329844023fef Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 3 Jan 2012 08:21:09 +0100 Subject: [PATCH] init.sh: do not try to accommodate compare arguments starting with "-" * tests/init.sh (compare_dev_null_): Do not try to accommodate compare arguments that start with "-". Besides, we do not worry about this when invoking diff or cmp; why start now with sed? Using "--" to separate options from argument would trigger sed failure in at least Solaris 7, HP-UX 11.00, IRIX 6.5, FreeBSD 6.4, OpenBSD 4.9 and NetBSD 5.1. Reported by Bruno Haible. --- ChangeLog | 10 ++++++++++ tests/init.sh | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d097810d8..5d1709bb6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2012-01-03 Jim Meyering + + init.sh: do not try to accommodate compare arguments starting with "-" + * tests/init.sh (compare_dev_null_): Do not try to accommodate + compare arguments that start with "-". Besides, we do not worry + about this when invoking diff or cmp; why start now with sed? + Using "--" to separate options from argument would trigger sed + failure in at least Solaris 7, HP-UX 11.00, IRIX 6.5, FreeBSD 6.4, + OpenBSD 4.9 and NetBSD 5.1. Reported by Bruno Haible. + 2012-01-02 Bruno Haible Enhance tests for module 'isatty'. diff --git a/tests/init.sh b/tests/init.sh index 5d3e2be1d..948549262 100644 --- a/tests/init.sh +++ b/tests/init.sh @@ -242,13 +242,13 @@ compare_dev_null_ () if test "x$1" = x/dev/null; then test -s "$2" || return 0 - emit_diff_u_header_ "$@"; sed 's/^/+/' -- "$2" + emit_diff_u_header_ "$@"; sed 's/^/+/' "$2" return 1 fi if test "x$2" = x/dev/null; then test -s "$1" || return 0 - emit_diff_u_header_ "$@"; sed 's/^/-/' -- "$1" + emit_diff_u_header_ "$@"; sed 's/^/-/' "$1" return 1 fi -- 2.11.0