From a7f5d3d6d671bb4e9117b1f72971a19eed135fed Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 23 Feb 2016 01:03:55 -0800 Subject: all: be less strict about usage if POSIX 2008 sort, tail, and uniq now support traditional usage like 'sort +2' and 'tail +10' on systems conforming to POSIX 1003.1-2008 and later. * NEWS: Document this. * doc/coreutils.texi (Standards conformance, tail invocation) (sort invocation, uniq invocation, touch invocation): Document new behavior, or behavior's dependence on POSIX 1003.1-2001. * src/sort.c (struct keyfield.traditional_used): Rename from obsolete_used, since implementations are now allowed to support it. All uses changed. (main): Allow traditional usage if _POSIX2_VERSION is 200809. * src/tail.c (parse_obsolete_option): Distinguish between traditional usage (which POSIX 2008 and later allows) and obsolete (which it still does not). * src/uniq.c (strict_posix2): New function. (main): Allow traditional usage if _POSIX2_VERSION is 200809. * tests/misc/tail.pl: Test for new behavior. --- tests/misc/tail.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/misc') diff --git a/tests/misc/tail.pl b/tests/misc/tail.pl index 0d9bc4834..57ed62db5 100755 --- a/tests/misc/tail.pl +++ b/tests/misc/tail.pl @@ -116,12 +116,15 @@ foreach my $t (@tv) $ret and push @$e, {EXIT=>$ret}, {ERR=>$err_msg}, {ERR_SUBST=>$err_sub}; - $test_name =~ /^(obs-plus-|minus-)/ + $test_name =~ /^minus-/ and push @$e, {ENV=>'_POSIX2_VERSION=199209'}; $test_name =~ /^(err-6|c-2)$/ and push @$e, {ENV=>'_POSIX2_VERSION=200112'}; + $test_name =~ /^obs-plus-/ + and push @$e, {ENV=>'_POSIX2_VERSION=200809'}; + $test_name =~ /^f-pipe-/ and push @$e, {ENV=>'POSIXLY_CORRECT=1'}; -- cgit v1.2.3-70-g09d2