* NEWS: Mention the bug fix.
* cfg.mk (exclude_file_name_regexp--sc_prohibit_test_minus_ao): Exclude
NEWS.
* src/test.c (term): Treat '-a' and '-o' as strings instead of expecting
them to be valid unary operators.
* tests/test/test.pl: Add some test cases.
* tests/test/test-diag.pl: Also test the diagnostics with '-a arg'.
'tee' no longer treats short writes as errors.
[bug introduced in coreutils-9.11]
+ 'test' no longer treats '-a' and '-o' as operators when given as strings to a
+ binary operator. E.g., 'test -a -a -a' exits successfully instead of exiting
+ with an error.
+ [This bug was present in "the beginning".]
+
'unexpand -t' no longer overflows a heap buffer, for tab values > SIZE_MAX/16,
or with multi-byte blank characters longer than the tab value.
[bugs introduced in coreutils-9.11]
^m4/stat-prog\.m4$$
exclude_file_name_regexp--sc_prohibit_fail_0 = \
(^.*/git-hooks/commit-msg|^tests/init\.sh|Makefile\.am|\.mk|.*\.texi)$$
-exclude_file_name_regexp--sc_prohibit_test_minus_ao = doc/.*\.texi$$
+exclude_file_name_regexp--sc_prohibit_test_minus_ao = NEWS|doc/.*\.texi$$
exclude_file_name_regexp--sc_prohibit_atoi_atof = ^lib/euidaccess-stat\.c$$
# longlong.h is maintained elsewhere.
value = binary_operator (false, bop);
/* It might be a switch type argument. */
- else if (argv[pos][0] == '-' && argv[pos][1] && argv[pos][2] == '\0')
+ else if (argv[pos][0] == '-' && argv[pos][1] && argv[pos][1] != 'a'
+ && argv[pos][1] != 'o' && argv[pos][2] == '\0')
value = unary_operator ();
else
{
my @Tests =
(
# In coreutils-5.93, this diagnostic lacked the newline.
- ['o', '-o arg', {ERR => "test: '-o': unary operator expected\n"},
- {ERR_SUBST => 's!^.*test:!test:!'},
- {EXIT => 2}],
+ map {[$_, "-$_ arg", {ERR => "test: '-$_': unary operator expected\n"},
+ {ERR_SUBST => 's!^.*test:!test:!'}, {EXIT => 2}]} qw(o a),
);
my $save_temps = $ENV{DEBUG};
['greater-collate-3', "'a' '>' 'b'", {EXIT=>1}],
);
+# Test the behavior of multiple adjacent binary operators.
+# These would not behave correctly in coreutils-9.11 and earlier.
+my $i = 1;
+my @operands = ('-a', '-o', "''");
+for my $b ('-a', '-o')
+ {
+ for my $a (@operands)
+ {
+ for my $c (@operands)
+ {
+ push @Tests, ["multiple-binary-" . ++$i, "$a $b $c",
+ {EXIT=>0 + (($b eq '-o')
+ ? ($a eq "''" && $c eq "''")
+ : ($a eq "''" || $c eq "''"))}];
+ }
+ }
+ }
+
@Tests = add_inverse_op_tests \@Tests;
@Tests = add_pn_tests \@Tests;